Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
ea5cee1
Bump nokogiri from 1.10.5 to 1.10.8
dependabot[bot] Feb 27, 2020
19ead50
Bump websocket-extensions from 0.1.4 to 0.1.5
dependabot[bot] Jun 6, 2020
cd08b95
Bump rack from 2.0.7 to 2.2.3
dependabot[bot] Jun 25, 2020
ed584a3
Merge pull request #73 from EngSwCIC/dependabot/bundler/rack-2.2.3
icaronr Sep 24, 2020
8d75616
Bump puma from 3.12.1 to 3.12.6
dependabot[bot] Sep 24, 2020
40a5769
Merge pull request #72 from EngSwCIC/dependabot/bundler/websocket-ext…
icaronr Sep 24, 2020
038a318
Merge pull request #74 from EngSwCIC/dependabot/bundler/puma-3.12.6
icaronr Sep 24, 2020
37d96d1
Merge pull request #69 from EngSwCIC/dependabot/bundler/nokogiri-1.10.8
icaronr Sep 24, 2020
0fb9609
Add information BDD feature
GustavoMacCar Oct 25, 2020
a19dbdd
View information BDD feature
Oct 26, 2020
7b5d34b
filter information by source BDD feature
silvaricardo1997 Oct 26, 2020
b206132
AdminControl BDD Test
RodBorneo Oct 26, 2020
bdea5a4
Added view_informations steps
Oct 27, 2020
57726fa
issue18
DataCoreDev Oct 27, 2020
99781d0
AdminControl com Cucumber
RodBorneo Oct 27, 2020
f92d3f9
Add RSpec test and edit cucumber test
Oct 29, 2020
9f1e639
RSpec test for infomations filter by source
silvaricardo1997 Oct 29, 2020
f63038f
skeleton of rspec for add information
GustavoMacCar Oct 30, 2020
cad2af4
Teste do rspec
RodBorneo Oct 30, 2020
4be1dfc
issue18
DataCoreDev Oct 30, 2020
53f78b5
Merge remote-tracking branch 'origin/AddInformation'
Oct 30, 2020
fc89470
Merge remote-tracking branch 'origin/AdminControl'
Oct 30, 2020
98e31e6
Merge remote-tracking branch 'origin/issue17'
Oct 30, 2020
1938ed7
Merge remote-tracking branch 'origin/issue18'
Oct 30, 2020
20d291d
Implementação da feature 16
Nov 11, 2020
19e768c
Implementação de testes BDD e TDD
Nov 11, 2020
5f749f9
Merge branch 'View_Information' of https://github.com/GuCosta/secreta…
GustavoMacCar Nov 13, 2020
c6ea6c9
cadastro de fonte funcionando
RodBorneo Nov 13, 2020
9e4d4b7
before stash apply
GustavoMacCar Nov 13, 2020
4bc58db
Edit routes and VC
Nov 13, 2020
bf782c0
issue18
DataCoreDev Nov 14, 2020
f80f632
cadastro de fonte atualizado
RodBorneo Nov 15, 2020
e59b6ba
add information functionalities and cucumber test
GustavoMacCar Nov 15, 2020
022b558
published_by visualization
GustavoMacCar Nov 15, 2020
f9ae110
rspec tests for new information and extra functionalities for source
GustavoMacCar Nov 15, 2020
f04b222
teste Rspec passndo para os cenários
RodBorneo Nov 16, 2020
f4230e7
Edit routes e controller
Nov 16, 2020
56de46b
Merge branch 'View_Information' of https://github.com/GuCosta/secreta…
GustavoMacCar Nov 16, 2020
d763f4e
pull from AdminControl and View_Information
GustavoMacCar Nov 16, 2020
539c1da
refactored issue 18 and some functionalities
GustavoMacCar Nov 18, 2020
d8be1bc
Refactored informations filter
silvaricardo1997 Nov 18, 2020
e133b80
Merge pull request #3 from GuCosta/issue17
silvaricardo1997 Nov 18, 2020
df768fa
information show action
GustavoMacCar Nov 21, 2020
07a1dd6
information edit and update actions
GustavoMacCar Nov 21, 2020
44d386f
notifications and usernotifications models
GustavoMacCar Nov 22, 2020
40db301
notifications new and index refactor
GustavoMacCar Nov 22, 2020
c5c5e7d
notification functionality
GustavoMacCar Nov 23, 2020
9a11fa0
rewritten messages
GustavoMacCar Nov 23, 2020
4f1b33d
TODO: fix current user template bug
GustavoMacCar Nov 23, 2020
742f575
current_user nil bug fix in rspec test
GustavoMacCar Nov 25, 2020
5de952e
saikuro, rubycritic, coverage
GustavoMacCar Nov 29, 2020
3f110a2
added gems to gemfile
GustavoMacCar Nov 29, 2020
7e03704
notificaiton test coverage
GustavoMacCar Dec 1, 2020
218973b
denies access to non admin user to new and edit pagesthrough the url
GustavoMacCar Dec 1, 2020
6e05794
90% test coverage for all controller/model except aplications controller
GustavoMacCar Dec 2, 2020
693dfa8
sad paths
GustavoMacCar Dec 3, 2020
55c970d
cucumber
GustavoMacCar Dec 3, 2020
036a06d
rdoc
GustavoMacCar Dec 4, 2020
49bd54f
entrega final
GustavoMacCar Dec 4, 2020
def97f7
add rubycritic
GustavoMacCar Dec 4, 2020
3ab5cb8
Merge pull request #8 from GuCosta/addinformation_sprint3
GustavoMacCar Dec 5, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
#/tmp/*
!/log/.keep
!/tmp/.keep

Expand Down
10 changes: 8 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@ source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.6.3'

gem 'simplecov', require: false, group: :test
gem "rubycritic", require: false
gem 'metric_fu-Saikuro', require: false
gem 'flog'
gem 'rdoc'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2.3'
# Use postgresql as the database for Active Record
gem 'pg', '>= 0.18', '< 2.0'
# Use Puma as the app server
gem 'puma', '~> 3.11'
gem 'puma', '~> 3.12'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
Expand Down Expand Up @@ -42,6 +46,7 @@ group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
gem 'rspec-rails'
gem 'factory_bot_rails'

end

Expand All @@ -64,6 +69,7 @@ group :test do
# database_cleaner is not required, but highly recommended
gem 'database_cleaner'
gem 'shoulda-matchers'
gem 'database_cleaner-active_record'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
Expand Down
87 changes: 82 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ GEM
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
arel (9.0.0)
ast (2.4.1)
axiom-types (0.1.1)
descendants_tracker (~> 0.0.4)
ice_nine (~> 0.11.0)
thread_safe (~> 0.3, >= 0.3.1)
backports (3.15.0)
bcrypt (3.1.13)
bindex (0.8.1)
Expand All @@ -61,6 +66,8 @@ GEM
regexp_parser (~> 1.5)
xpath (~> 3.2)
childprocess (3.0.0)
coercible (1.0.0)
descendants_tracker (~> 0.0.1)
coffee-rails (4.2.2)
coffee-script (>= 2.2.0)
railties (>= 4.0.0)
Expand Down Expand Up @@ -93,23 +100,50 @@ GEM
cucumber-tag_expressions (1.1.1)
cucumber-wire (0.0.1)
database_cleaner (1.7.0)
database_cleaner-active_record (2.0.0.beta2)
activerecord
database_cleaner-core (~> 2.0.0.beta2)
database_cleaner-core (2.0.0.beta2)
descendants_tracker (0.0.4)
thread_safe (~> 0.3, >= 0.3.1)
devise (4.7.1)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0)
responders
warden (~> 1.2.3)
diff-lcs (1.3)
docile (1.3.2)
equalizer (0.0.11)
erubi (1.9.0)
erubis (2.7.0)
execjs (2.7.0)
factory_bot (6.1.0)
activesupport (>= 5.0.0)
factory_bot_rails (6.1.0)
factory_bot (~> 6.1.0)
railties (>= 5.0.0)
ffi (1.11.1)
flay (2.12.1)
erubis (~> 2.7.0)
path_expander (~> 1.0)
ruby_parser (~> 3.0)
sexp_processor (~> 4.0)
flog (4.6.4)
path_expander (~> 1.0)
ruby_parser (~> 3.1, > 3.1.0)
sexp_processor (~> 4.8)
gherkin (5.1.0)
globalid (0.4.2)
activesupport (>= 4.2.0)
i18n (1.7.0)
concurrent-ruby (~> 1.0)
ice_nine (0.11.2)
jbuilder (2.9.1)
activesupport (>= 4.2.0)
kwalify (0.7.2)
launchy (2.5.0)
addressable (~> 2.7)
listen (3.1.5)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
Expand All @@ -122,6 +156,7 @@ GEM
marcel (0.3.3)
mimemagic (~> 0.3.2)
method_source (0.9.2)
metric_fu-Saikuro (1.1.3)
mime-types (3.3)
mime-types-data (~> 3.2015)
mime-types-data (3.2019.1009)
Expand All @@ -133,13 +168,17 @@ GEM
multi_json (1.14.1)
multi_test (0.1.2)
nio4r (2.5.2)
nokogiri (1.10.5)
nokogiri (1.10.8)
mini_portile2 (~> 2.4.0)
orm_adapter (0.5.0)
parser (2.7.2.0)
ast (~> 2.4.1)
path_expander (1.1.0)
pg (1.1.4)
psych (3.1.0)
public_suffix (4.0.1)
puma (3.12.1)
rack (2.0.7)
puma (3.12.6)
rack (2.2.3)
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (5.2.3)
Expand All @@ -166,10 +205,17 @@ GEM
method_source
rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0)
rainbow (3.0.0)
rake (13.0.0)
rb-fsevent (0.10.3)
rb-inotify (0.10.0)
ffi (~> 1.0)
rdoc (6.2.1)
reek (6.0.2)
kwalify (~> 0.7.0)
parser (>= 2.5.0.0, < 2.8, != 2.5.1.1)
psych (~> 3.1)
rainbow (>= 2.0, < 4.0)
regexp_parser (1.6.0)
responders (3.0.0)
actionpack (>= 5.0)
Expand All @@ -192,6 +238,19 @@ GEM
rspec-support (~> 3.9.0)
rspec-support (3.9.0)
ruby_dep (1.5.0)
ruby_parser (3.15.0)
sexp_processor (~> 4.9)
rubycritic (4.5.2)
flay (~> 2.8)
flog (~> 4.4)
launchy (>= 2.0.0)
parser (>= 2.6.0)
rainbow (~> 3.0)
reek (~> 6.0, < 7.0)
ruby_parser (~> 3.8)
simplecov (>= 0.17.0)
tty-which (~> 0.4.0)
virtus (~> 1.0)
rubyzip (2.0.0)
sass (3.7.4)
sass-listen (~> 4.0.0)
Expand All @@ -207,8 +266,13 @@ GEM
selenium-webdriver (3.142.6)
childprocess (>= 0.5, < 4.0)
rubyzip (>= 1.2.2)
sexp_processor (4.15.1)
shoulda-matchers (4.1.2)
activesupport (>= 4.2.0)
simplecov (0.19.1)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov-html (0.12.3)
spring (2.1.0)
spring-watcher-listen (2.0.1)
listen (>= 2.7, < 4.0)
Expand All @@ -223,13 +287,19 @@ GEM
thor (0.20.3)
thread_safe (0.3.6)
tilt (2.0.10)
tty-which (0.4.2)
turbolinks (5.2.1)
turbolinks-source (~> 5.2)
turbolinks-source (5.2.0)
tzinfo (1.2.5)
thread_safe (~> 0.1)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
virtus (1.0.5)
axiom-types (~> 0.1)
coercible (~> 1.0)
descendants_tracker (~> 0.0, >= 0.0.3)
equalizer (~> 0.0, >= 0.0.9)
warden (1.2.8)
rack (>= 2.0.6)
web-console (3.7.0)
Expand All @@ -243,7 +313,7 @@ GEM
selenium-webdriver (>= 3.0, < 4.0)
websocket-driver (0.7.1)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.4)
websocket-extensions (0.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)

Expand All @@ -257,16 +327,23 @@ DEPENDENCIES
coffee-rails (~> 4.2)
cucumber-rails
database_cleaner
database_cleaner-active_record
devise
factory_bot_rails
flog
jbuilder (~> 2.5)
listen (>= 3.0.5, < 3.2)
metric_fu-Saikuro
pg (>= 0.18, < 2.0)
puma (~> 3.11)
puma (~> 3.12)
rails (~> 5.2.3)
rdoc
rspec-rails
rubycritic
sass-rails (~> 5.0)
selenium-webdriver
shoulda-matchers
simplecov
spring
spring-watcher-listen (~> 2.0.0)
turbolinks (~> 5)
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

require_relative 'config/application'

require 'metric_fu'
Rails.application.load_tasks
3 changes: 3 additions & 0 deletions app/assets/javascripts/source.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
3 changes: 3 additions & 0 deletions app/assets/stylesheets/source.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the Source controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
3 changes: 3 additions & 0 deletions app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ class ApplicationController < ActionController::Base
protected

def configure_permitted_parameters
# :nocov:
devise_parameter_sanitizer.permit(:sign_up, keys: %i[full_name role])
# :nocov:
end
end

2 changes: 2 additions & 0 deletions app/controllers/debug.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[1125/025039.881:ERROR:directory_reader_win.cc(43)] FindFirstFile: O sistema n�o pode encontrar o caminho especificado. (0x3)
[1127/021137.864:ERROR:directory_reader_win.cc(43)] FindFirstFile: O sistema n�o pode encontrar o caminho especificado. (0x3)
108 changes: 108 additions & 0 deletions app/controllers/informations_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
class InformationsController < ApplicationController
##
# Esse metodo representa a ação index da classe information e renderiza a view
# index, que exibe todas informações cadastradas ou apenas as informações postadas por
# uma determinada fonte, passada como parâmetro para esse método juntamente com a informação postada.
# Não retorna nenhum valor e não redireciona o usuário.
def index
if params[:information] and params[:information][:source_id]
@informations = Information.search(params[:information][:source_id]).order("created_at DESC")

else
@informations = Information.all.order("created_at DESC")
end
end

##
# Esse método representa a ação new da classe information.
# Renderiza a new view, que recebe dados para a criação de uma nova informação.
# Vale notar que a new view recebe todas fontes cadastradas,
# para a possiblitar funcionalidade de filtrar notícias por fonte.
# Não retorna valor e não redireciona o usuário.
def new
@information = Information.new
@sources=Source.all
#@information = Information.new(info_params)
end

##
# Esse é o método responsável por adicionar uma nova entrada no banco de dados com os dados inseridos na view new,
# caso os dados recebidos sejam válidos.
# Caso os dados sejam válidos, uma nova entrada é criada no banco de dados e o usuário é
# redirecionado para a view index das informações. Caso os dados não sejam válidos, o usuário é
# redirecionado para a view new e uma mensagem de erro é exibida na tela.
# O método não retorna nenhum valor.
def create
params.require(:information)
params[:information].permit(information_params)
@information = Information.new(information_params.merge(:published_by => current_user.id))
if @information.save
redirect_to informations_path
else
redirect_to new_information_path,alert:"Ocorreu um erro."
end
#redirect_to informations_path
end

##
# Ação destroy da classe Information. Recebe como argumento alguma informação enviada
# para o servidor. Essa informação é então removida do banco de dados, o usuário é
# redirecionado para a view index de informações e uma mensagem confirmando a exclusão da
# informação é exibida na tela.
# Não retorna valores.
def destroy
@information = Information.find(params[:id])
@information.destroy
flash[:notice] = "#{@information.title} removido."
redirect_to informations_path
end

##
# Ação show da classe Information. Recebe uma informação como argumento, econtra essa informação no
# banco de dados e renderiza a view show para aquela informação.
# Não retorna valores e não redireciona o usuário.
def show
id = params[:id]
@information = Information.find(id)
end

##
# Ação de edit da classe Information. Recebe uma informação como argumento, encontra essa informação no
# banco de dados e renderiza a view edit. Vale notar que essa view é bastante parecida com a view new, salvo
# que os dados atuais da informação a ser editada já são renderizados junto da página.
# As fontes de informação cadastradas são enviadas para o servidor junto com a informação para que seja possível
# mudar a fonte da informação, caso desejado. Não retorna valores e não redireciona o usuário.
def edit
@information = Information.find params[:id]
@sources=Source.all
end

##
# O método que é responsável por atualizar uma informação com os dados inseridos na view edit. Recebe
# os dados enviados pela edit view ao servidor. Caso os dados enviados sejam válidos, a entrada é modificada no banco
# de dados e o usuário é redirecionado para a view show da informação atualizada. Caso contrário, O usuário é redirecionado
# para a view index e uma mensagem de erro é exibida na tela. Não retorna valores.
# Vale dizer que quando dados inválidos são recebidos, uma exceção é lançada e, por meio do tratamento dessa exceção
# é que se realiza o procedimento para redirecionar o usuário e exibir a mensagem de erro na tela.
def update
@information = Information.find params[:id]
@information.update_attributes!(information_params)
rescue ActiveRecord::RecordInvalid
flash[:notice] = "Ocorreu um erro."
redirect_to informations_path
else
flash[:notice] = "Informação atualizada."
redirect_to information_path(@information)
end


private

##
# Permite que os atributos das infromações possam ser acessados por outros métodos neste módulo.
def information_params
params.require(:information).permit(:title, :content, :source_id, :published_by)
end

end

Loading