Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 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
ed6dd2c
Adiciona featurs e .rb de Editar processos e Adicionar comentários
Oct 28, 2020
9f3caa9
New Feature: Criando Processos como secretario
Oct 29, 2020
32c66f9
Atualizando o projeto para seguir o banco do icaro
Oct 30, 2020
75f7368
Adiciona feature e teste de consultar processo
clarice42 Oct 30, 2020
d4a91ff
Adiciona rspec e novos cucumbers - editar processo e adicionar comena…
Oct 30, 2020
6755fd3
refatora de steps
Oct 30, 2020
3faef7f
Merge branch 'feature/show_process' of https://github.com/aliceborges…
Oct 30, 2020
1c27acd
Merge branch 'feature_newprocess' of https://github.com/aliceborges42…
Oct 30, 2020
540d437
renomeia criar processos
Oct 31, 2020
36e6a5e
atualiza arquivos .feature
Oct 31, 2020
6262435
atualiza arquivos de step definitions
Oct 31, 2020
c9f3e54
Faz rspec das controllers
Oct 31, 2020
3617df3
Faz rspec das models de comentarios e processos
Oct 31, 2020
2faf312
apaga lixo
Oct 31, 2020
315b079
scaffold da tabela wiki e comentario
Nov 11, 2020
31adc19
refatora controllers
Nov 12, 2020
a311b56
refatora models
Nov 12, 2020
4538d8c
refatora testes spec de controllers
Nov 12, 2020
db08f33
muda migrations - liga comment e wiki
Nov 12, 2020
33f9ce2
help
Nov 12, 2020
79a765e
renomeia migrates
Nov 13, 2020
83b51eb
Renomeia variáveis, views e rotas
clarice42 Nov 13, 2020
438329e
Adiciona css para as views [:WIP]
clarice42 Nov 13, 2020
b95c31a
deleta arquios desnecessários
Nov 13, 2020
b7f01e3
adiciona validações em WikiEntry
Nov 13, 2020
c9637ec
refatora testes model
Nov 13, 2020
c9ef624
adiciona active storage
Nov 13, 2020
9850977
documento de teste
Nov 13, 2020
49a163a
adiciona testes controller e cucumber
Nov 13, 2020
3b186a6
resolve conflitos
Nov 13, 2020
7d97ec4
Refatorando testes e criando relação wiki_comments
Nov 13, 2020
111d5ed
adiciona rspec model comment
Nov 13, 2020
e3398d5
adiciona atributos válidos e inválidos rspec controllers
Nov 15, 2020
81b96e6
Merge branch 'feature/testes-wiki' of https://github.com/aliceborges4…
Nov 15, 2020
3728555
Faz TDD de controllers
Nov 16, 2020
63c30a5
Testes cucumber e rspec passando
Nov 16, 2020
36bf8bc
Adicionando a gema simplecov e seus require para verificação de cober…
Nov 24, 2020
aa1eeae
Relatórios de complexidade ciclomática todos com complexidade <10
Nov 24, 2020
7406947
Arquivo relativo a coverage
Nov 24, 2020
7c19f19
Adição de comentários no estilo rspec
Nov 24, 2020
a4ed5fb
Adicionando o caminho triste na parte de consultar entrada da wiki
Nov 24, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .simplecov
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
SimpleCov.start 'rails' do
# any custom configs like groups and filters can be here at a central place
enable_coverage :branch
add_filter "app/channels/application_cable/connection.rb"
add_filter "app/jobs/application_job.rb"
add_filter "app/mailers/application_mailer.rb"
add_filter "app/channels/application_cable/channel.rb"
add_filter "app/controllers/application_controller.rb"
add_filter "app/controllers/home_controller.rb"



end
10 changes: 9 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ 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 @@ -36,12 +36,17 @@ gem 'jbuilder', '~> 2.5'
# gem 'capistrano-rails', group: :development

# Reduces boot times through caching; required in config/boot.rb
#Documentation
gem 'rdoc', '~> 4.2', '>= 4.2.2'
#Coverage of tests
gem 'simplecov', require: false, group: :test
gem 'bootsnap', '>= 1.1.0', require: false

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,7 +69,10 @@ group :test do
# database_cleaner is not required, but highly recommended
gem 'database_cleaner'
gem 'shoulda-matchers'
gem 'cucumber-rails-training-wheels'
gem 'launchy'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'activestorage-validator'
33 changes: 28 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ GEM
actionpack (= 5.2.3)
activerecord (= 5.2.3)
marcel (~> 0.3.1)
activestorage-validator (0.1.3)
rails (>= 5.2.0)
activesupport (5.2.3)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
Expand Down Expand Up @@ -90,6 +92,8 @@ GEM
mime-types (>= 2.0, < 4)
nokogiri (~> 1.8)
railties (>= 4.2, < 7)
cucumber-rails-training-wheels (1.0.0)
cucumber-rails (>= 1.1.1)
cucumber-tag_expressions (1.1.1)
cucumber-wire (0.0.1)
database_cleaner (1.7.0)
Expand All @@ -100,8 +104,14 @@ GEM
responders
warden (~> 1.2.3)
diff-lcs (1.3)
docile (1.3.2)
erubi (1.9.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)
gherkin (5.1.0)
globalid (0.4.2)
Expand All @@ -110,6 +120,8 @@ GEM
concurrent-ruby (~> 1.0)
jbuilder (2.9.1)
activesupport (>= 4.2.0)
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 @@ -133,13 +145,13 @@ 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)
pg (1.1.4)
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 Down Expand Up @@ -170,6 +182,7 @@ GEM
rb-fsevent (0.10.3)
rb-inotify (0.10.0)
ffi (~> 1.0)
rdoc (4.3.0)
regexp_parser (1.6.0)
responders (3.0.0)
actionpack (>= 5.0)
Expand Down Expand Up @@ -209,6 +222,10 @@ GEM
rubyzip (>= 1.2.2)
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 Down Expand Up @@ -243,30 +260,36 @@ 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)

PLATFORMS
ruby

DEPENDENCIES
activestorage-validator
bootsnap (>= 1.1.0)
byebug
capybara (>= 2.15)
coffee-rails (~> 4.2)
cucumber-rails
cucumber-rails-training-wheels
database_cleaner
devise
factory_bot_rails
jbuilder (~> 2.5)
launchy
listen (>= 3.0.5, < 3.2)
pg (>= 0.18, < 2.0)
puma (~> 3.11)
puma (~> 3.12)
rails (~> 5.2.3)
rdoc (~> 4.2, >= 4.2.2)
rspec-rails
sass-rails (~> 5.0)
selenium-webdriver
shoulda-matchers
simplecov
spring
spring-watcher-listen (~> 2.0.0)
turbolinks (~> 5)
Expand Down
3 changes: 3 additions & 0 deletions app/assets/javascripts/comentarios.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/javascripts/wikis.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/comentarios.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the Comentarios controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
84 changes: 84 additions & 0 deletions app/assets/stylesheets/scaffolds.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
body {
background-color: #fff;
color: #333;
margin: 33px;
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px;
}

p, ol, ul, td {
font-family: verdana, arial, helvetica, sans-serif;
font-size: 13px;
line-height: 18px;
}

pre {
background-color: #eee;
padding: 10px;
font-size: 11px;
}

a {
color: #000;

&:visited {
color: #666;
}

&:hover {
color: #fff;
background-color: #000;
}
}

//th {
// padding-bottom: 5px;
//}

//td {
// padding: 0 5px 7px;
//}

div {
&.field, &.actions {
margin-bottom: 10px;
}
}

#notice {
color: green;
}

.field_with_errors {
padding: 2px;
background-color: red;
display: table;
}

#error_explanation {
width: 450px;
border: 2px solid red;
padding: 7px 7px 0;
margin-bottom: 20px;
background-color: #f0f0f0;

h2 {
text-align: left;
font-weight: bold;
padding: 5px 5px 5px 15px;
font-size: 12px;
margin: -7px -7px 0;
background-color: #c00;
color: #fff;
}

ul li {
font-size: 12px;
list-style: square;
}
}

label {
display: block;
}
40 changes: 40 additions & 0 deletions app/assets/stylesheets/wikis.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
// Place all the styles related to the Wikis controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

.title {
color: #000;
font-size: 40px;
font-family: Arial, sans-serif;
font-weight: bold;
margin-bottom: 15px;
text-align: center;
}

.listEntries {
width: 100%;

& > table {
table-layout: fixed;
border-collapse: separate;
border-spacing: 0 15px;
margin: 15px 0;
width: 100%;
overflow-wrap: break-word;

& > thead > tr > th {
color: #000;
font-size: 30px;
}

& > tbody > tr > td {
color: #000;
font-size: 20px;
margin-left: 150px;

& > td {
text-align: center;
}
}
}
}
86 changes: 86 additions & 0 deletions app/controllers/wiki_comments_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
class WikiCommentsController < ApplicationController
before_action :set_comment, only: [:show, :edit, :update, :destroy]
before_action :set_entry, only:[:index, :new, :create]

# GET /comments
# GET /comments.json
def index
#Método que recupera um array com todos os comentários
@comments = WikiComment.all
end

# GET /comments/1
# GET /comments/1.json
def show
end

# GET /comments/new
def new
@comment = WikiComment.new
end

# GET /comments/1/edit
def edit
end

# POST /comments
# POST /comments.json
def create
#Método para a criação do comentário que faz a ligação da existencia desse comentário com uma Wikientry já criada, pois sem isso o comentário não pode existir
@comment = WikiComment.new(comment_params.merge({entry: @entry}))
#verifica se o comentario pode ser salvo e se sim renderiza a página da entry a qual o comentário pertence, caso contrário, retorna um erro
respond_to do |format|
if @comment.save
format.html { redirect_to @comment.entry, notice: 'Comentário foi criado com sucesso.' }
format.json { render :show, status: :created, location: @comment }
else
format.html { render :new }
format.json { render json: @comment.errors, status: :unprocessable_entity }
end
end
end

# PATCH/PUT /comments/1
# PATCH/PUT /comments/1.json
def update
#Método que permite a atualização de um comentário. Esse método não está sendo utilizado no momento.
respond_to do |format|
if @comment.update(comment_params)
format.html { redirect_to @comment.entry, notice: 'Comentário foi editado com sucesso.' }
format.json { render :show, status: :ok, location: @comment.entry }
else
format.html { render :edit }
format.json { render json: @comment.errors, status: :unprocessable_entity }
end
end
end

# DELETE /comments/1
# DELETE /comments/1.json
def destroy
@comment.destroy
respond_to do |format|
format.html { redirect_to @comment.entry, notice: 'Comentário foi excluído com sucesso.' }
format.json { head :no_content }
end
end

private
# Use callbacks to share common setup or constraints between actions.
def set_comment
#Método para localizar o comentário com a id específica
@comment = WikiComment.find(params[:id])
end


def set_entry
#método para localizar a WikiEntry a qual o comentário pertence e ele é chamado antes das ações index, new e create dos comentários para que seja possível recupera-los ou setá-los em relação as devidas WikiEntries
@entry = WikiEntry.find(params[:wiki_entry_id])
end

# Never trust parameters from the scary internet, only allow the white list through.
def comment_params
#Parametros permitidos a um comentário
params.require(:wiki_comment).permit(:content)
end
end
Loading