diff --git a/Gemfile b/Gemfile index d034287e..54be0f4e 100644 --- a/Gemfile +++ b/Gemfile @@ -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 diff --git a/Gemfile.lock b/Gemfile.lock index 1c0f8f1e..0a9e4f86 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -133,13 +133,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) @@ -243,7 +243,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) @@ -261,7 +261,7 @@ DEPENDENCIES jbuilder (~> 2.5) listen (>= 3.0.5, < 3.2) pg (>= 0.18, < 2.0) - puma (~> 3.11) + puma (~> 3.12) rails (~> 5.2.3) rspec-rails sass-rails (~> 5.0) diff --git a/features/addActivity.feature b/features/addActivity.feature new file mode 100644 index 00000000..fedd6cdd --- /dev/null +++ b/features/addActivity.feature @@ -0,0 +1,24 @@ +#language: pt + +Funcionalidade: Usuário pode adicionar uma atividade + + Como um administrador, para que eu tenha controle das atividades, + eu gostaria de cadastrar uma nova atividade e seu prazo de execução + +Cenário: Adicionar atividade de teste com sucesso + Dado que eu estou na página "Atividades" + Quando eu clico em "Nova atividade" + Então eu devo ser redirecionado para "Cadastrar nova atividade" + Quando eu preencho o campo "Título'" com "Teste" + E eu preencho o campo "Prazo de execução" com "Apr 30 1999" + E eu clico em "Salvar" + Então eu devo ser redirecionado para "Atividades" + E eu devo ver "Atividade cadastrada com sucesso" + +Cenário: Adicionar atividade de teste sem sucesso + Dado que eu estou na página "Atividades" + Quando eu clico em "Nova atividade" + Então eu devo ser redirecionado para "Cadastrar nova atividade" + Quando eu preencho o campo "Título" com "Teste 2" + E eu clico em "Salvar" + Então eu devo ver "O prazo de execução da atividade deve ser informado" \ No newline at end of file diff --git a/features/addPersonOnActivite.feature b/features/addPersonOnActivite.feature new file mode 100644 index 00000000..d9233035 --- /dev/null +++ b/features/addPersonOnActivite.feature @@ -0,0 +1,22 @@ +#language: pt + +Funcionalidade: Usuário pode adicionar pessoa interessada em uma atividade + + Como um administrador, para que eu possa informar a comunidade, eu gostaria de adicionar pessoas interessadas em cada atividade + + # Cenário Feliz + Cenário: Adicionar pessoa em atividade + Dado que estou na página "Atividades" + Quando eu clico em "Adicionar integrante" + Então eu devo ser redirecionado para "Cadastrar_novo_integrante" + Quando preencho o campo "Nome" com "Teste" + E preencho o campo "Email" com "teste@teste" + Então eu devo ser redirecionado para "Atividades" + E eu devo ver "Pessoa adicionada à atividade com sucesso" + + #Cenário Triste + Cenário: Página não encontrada + Dado que estou na página "Atividades" + Quando eu clico em "Adicionar pessoa interessada" + Então eu devo ser redirecionado para "404" + E eu devo ver "Página não encontrada" \ No newline at end of file diff --git a/features/notifyInterestedPeople.feature b/features/notifyInterestedPeople.feature new file mode 100644 index 00000000..4dc84a40 --- /dev/null +++ b/features/notifyInterestedPeople.feature @@ -0,0 +1,35 @@ +#language: pt + +Funcionalidade: Administrador notificar as pessoas interessadas + + Como um administrador, + Para que eu possa notificar as pessoas interessadas em alguma atividade, + Eu gostaria de notificar as pessoas interessadas + + #Pré-requisito + Background: Administrador está logado + Dado que estou na página "users/sign_in" + E preencho o campo "Email" com "admin@admin.com" + E preencho o campo "Password" com "admin123" + Quando pressiono "Log in" + Então eu devo ser redirecionado para "root_path" + + #Cenário feliz + Cenário: Notificar pessoas interessadas + Dado que estou na página "Atividades" + Quando pressiono "Notificar integrantes" + Então eu devo ser redirecionado para "Notificar_integrantes_selecionados" + Quando preencho o campo "Integrantes interessados" com os "Estudantes" + E pressiono "Enviar notificação" + Então eu devo ver "Notificação enviada aos interessados com sucesso" + + #Cenário triste + Cenário: Página não encontrada + Dado que estou na página "Atividades" + Quando pressiono "Notificar integrantes" + Então eu devo ser redirecionado para "404" + E eu devo ver "Página não encontrada" + +#estou contando que "Atividades" seja a página home de administração + + diff --git a/features/showInterestActivity.feature b/features/showInterestActivity.feature new file mode 100644 index 00000000..3ffd0f55 --- /dev/null +++ b/features/showInterestActivity.feature @@ -0,0 +1,29 @@ +#language: en + +#Como um usuário, para que eu possa me informar, +#eu gostaria de ver as atividades que eu demonstrei interesse #40 + +Feature: User actions + To use calendar + As a system user + I would like to see interests activities + + Background: User logged in + Given I am on the 'users/sign_in' page + And I fill in 'email' with 'student@student.com' + And I fill in 'password' with 'admin123' + When I press 'Log in' + Then I should be on 'root_path' page + + + Scenario: See Calendar page + When I press 'Calendar' + Then I should be on 'calendar' page + When I check 'Mostrar apenas minhas atividades de interesse' + Then I should see on 'calendar' page only 'interests activities' + + Scenario: See Activities page + When I press 'Atividades' + Then I should be on 'activities' page + When I press 'Filtrar por Interesse' + Then I should be on 'activities' page diff --git a/features/step_definitions/addActivity_steps.rb b/features/step_definitions/addActivity_steps.rb new file mode 100644 index 00000000..3ee77581 --- /dev/null +++ b/features/step_definitions/addActivity_steps.rb @@ -0,0 +1,19 @@ +Dado("que eu estou na página {string}") do |string| + visit "localhost:3000/#{string.downcase}" + end + + Quando("eu clico em {string}") do |string| + click_on string + end + + Então("eu devo ser redirecionado para {string}") do |string| + visit "localhost:3000/#{string.downcase}" + end + + Quando("eu preencho o campo {string} com {string}") do |string, string2| + fill_in string, with: string2 + end + + Então("eu devo ver {string}") do |string| + expect(page).to have_content string + end \ No newline at end of file diff --git a/features/step_definitions/addPersonOnActivite_steps.rb b/features/step_definitions/addPersonOnActivite_steps.rb new file mode 100644 index 00000000..90ca5e27 --- /dev/null +++ b/features/step_definitions/addPersonOnActivite_steps.rb @@ -0,0 +1,19 @@ +Dado("que estou na página {string}") do |string| + visit "localhost:3000/#{string.downcase}" +end + +Quando("eu clico em {string}") do |string| + click_on string +end + +Então("eu devo ser redirecionado para {string}") do |string| + visit "localhost:3000/#{string.downcase}" +end + +Quando("preencho o campo {string} com {string}") do |string1, string2| + fill_in string1, with: string2 +end + +E("eu devo ver {string}") do |string| + expect(page).to have_content string +end \ No newline at end of file diff --git a/features/step_definitions/notifyInterestedPeople_step.rb b/features/step_definitions/notifyInterestedPeople_step.rb new file mode 100644 index 00000000..8ae2ebb1 --- /dev/null +++ b/features/step_definitions/notifyInterestedPeople_step.rb @@ -0,0 +1,62 @@ +#Background +Dado("que eu estou na página {string}") do |string| + visit "localhost:3000/#{string.downcase}" +end + +E("preencho o campo {string} com {string}") do |string1, string2| + fill_in string1, with: string2 +end + +E("preencho o campo {string} com {string}") do |string1, string2| + fill_in string1, with: string2 +end + +Quando("pressiono {button}") do |button| + click_on(button) +end + +Então("eu devo ser redirecionado para {string}") do |string| + visit "localhost:3000/#{string.downcase}" +end + +#Cenário feliz +Dado("que eu estou na página {string}") do |string| + visit "localhost:3000/#{string.downcase}" +end + +Quando("pressiono {button}") do |button| + click_on(button) +end + +Então("eu devo ser redirecionado para {string}") do |string| + visit "localhost:3000/#{string.downcase}" +end + +Quando("preencho o campo {string} com {string}") do |string1, string2| + fill_in string1, with: string2 +end + +E("pressiono {button}") do |button| + click_on(button) +end + +Então("eu devo ver {string}") do |string| + expect(page).to have_content string +end + +#Cenário triste +Dado("que eu estou na página {string}") do |string| + visit "localhost:3000/#{string.downcase}" +end + +Quando("pressiono {button}") do |button| + click_on(button) +end + +Então("eu devo ser redirecionado para {string}") do |string| + visit "localhost:3000/#{string.downcase}" +end + +Então("eu devo ver {string}") do |string| + expect(page).to have_content string +end \ No newline at end of file diff --git a/features/step_definitions/showInterestActivity_steps.rb b/features/step_definitions/showInterestActivity_steps.rb new file mode 100644 index 00000000..cf1b192a --- /dev/null +++ b/features/step_definitions/showInterestActivity_steps.rb @@ -0,0 +1,52 @@ +Given("I am on the {string} page") do |string| + visit "localhost:3000/#{string.downcase}" + end + + And("I fill in 'email' with {string}") do |string| + fill_in string + end + + And("I fill in 'password' with {string}") do |string| + fill_in string + end + + When("I press {button}") do |button| + click_on(button) + end + + Then("I should be on {string}") do |string| + visit "localhost:3000" + end + + + When("I press {button}") do |button| + click_on(button) + end + + Then("I should be on {string}") do |string| + visit "localhost:3000/#{string.downcase}" + end + + When("I check {box}") do |box| + check(box) + end + + Then("I should see on 'calendar' page only {string}") do |string| + visit "localhost:3000/calendar//#{string.downcase}" + end + + When("I press {button}") do |button| + click_on(button) + end + + Then("I should be on {string}") do |string| + visit "localhost:3000/#{string.downcase}" + end + + When("I press {button}") do |button| + click_on(button) + end + + Then("I should be on {string}") do |string| + visit "localhost:3000/activities" + end diff --git a/spec/addPersonOnActivite_spec.rb b/spec/addPersonOnActivite_spec.rb new file mode 100644 index 00000000..221a23a4 --- /dev/null +++ b/spec/addPersonOnActivite_spec.rb @@ -0,0 +1,19 @@ +require 'rails_helper' + +RSpec.describe ".addPersonOnActivite" do + let(:uri) {'/Atividades'} + + context "Adicionar pessoa em atividade" do + let(:person) {Activite.addPerson("Teste", "teste@teste")} + + it "Mostra menssagem" do + page.driver.get uri + except(page.status_code).to be 200 + is_expected.to have "Pessoa adicionada com sucesso" + end + end + + context "Quando não encontrado" do + it {is_expected.to equal 404} + end +end \ No newline at end of file diff --git a/spec/controllers/activities_controller_spec.rb b/spec/controllers/activities_controller_spec.rb new file mode 100644 index 00000000..35049308 --- /dev/null +++ b/spec/controllers/activities_controller_spec.rb @@ -0,0 +1,19 @@ +require 'rails_helper' + +describe 'ActivitiesController' do + describe 'add a new Activity' do + it 'should call the model method that add a new Activity to the database' do + post :create, {} + end + + it 'should give a success message after an activity is successfuly added' do + post :create, {} + expect(response).to have_http_status(:success) + end + + it 'should give an error message if create is called without params' do + post :create + expect(response).to have_http_status(:error) + end + end +end \ No newline at end of file diff --git a/spec/notifyInterestedPeople_spec.rb b/spec/notifyInterestedPeople_spec.rb new file mode 100644 index 00000000..a64ab365 --- /dev/null +++ b/spec/notifyInterestedPeople_spec.rb @@ -0,0 +1,19 @@ +require 'rails_helper' + +RSpec.describe ".notifyInterestedPeople" do + let(:uri) {'/Atividades'} + + context "Notificar pessoas interessadas" do + let(:admin) {Activite.selectInterestedPeople("Estudantes")} + + it "Mostrar mensagem" do + page.driver.get uri + except(page.status_code).to be 200 + is_expected.to have "Notificação enviada aos interessados com sucesso" + end + end + + context "Página não encontrada" do + it {is_expected.to equal 404} + end +end diff --git a/spec/showInterestActivities_spec.rb b/spec/showInterestActivities_spec.rb new file mode 100644 index 00000000..e5c300fd --- /dev/null +++ b/spec/showInterestActivities_spec.rb @@ -0,0 +1,15 @@ +require 'rails_helper' + +RSpec.describe ".showInterestActivities" do + let(:uri) {'/Calendar'} + + context "Mostrar atividades de interesse" do + let(:activities) {showInterestActivities} + + it "Mostra menssagem" do + page.driver.get uri + except(page.status_code).to be 200 + is_expected.to have "localhost:3000/Calendar" + end + end +end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index ce33d66d..2ad573e7 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,96 +1,100 @@ -# This file was generated by the `rails generate rspec:install` command. Conventionally, all -# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. -# The generated `.rspec` file contains `--require spec_helper` which will cause -# this file to always be loaded, without a need to explicitly require it in any -# files. -# -# Given that it is always loaded, you are encouraged to keep this file as -# light-weight as possible. Requiring heavyweight dependencies from this file -# will add to the boot time of your test suite on EVERY test run, even for an -# individual file that may not need all of that loaded. Instead, consider making -# a separate helper file that requires the additional dependencies and performs -# the additional setup, and require it from the spec files that actually need -# it. -# -# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration -RSpec.configure do |config| - # rspec-expectations config goes here. You can use an alternate - # assertion/expectation library such as wrong or the stdlib/minitest - # assertions if you prefer. - config.expect_with :rspec do |expectations| - # This option will default to `true` in RSpec 4. It makes the `description` - # and `failure_message` of custom matchers include text for helper methods - # defined using `chain`, e.g.: - # be_bigger_than(2).and_smaller_than(4).description - # # => "be bigger than 2 and smaller than 4" - # ...rather than: - # # => "be bigger than 2" - expectations.include_chain_clauses_in_custom_matcher_descriptions = true - end - - # rspec-mocks config goes here. You can use an alternate test double - # library (such as bogus or mocha) by changing the `mock_with` option here. - config.mock_with :rspec do |mocks| - # Prevents you from mocking or stubbing a method that does not exist on - # a real object. This is generally recommended, and will default to - # `true` in RSpec 4. - mocks.verify_partial_doubles = true - end - - # This option will default to `:apply_to_host_groups` in RSpec 4 (and will - # have no way to turn it off -- the option exists only for backwards - # compatibility in RSpec 3). It causes shared context metadata to be - # inherited by the metadata hash of host groups and examples, rather than - # triggering implicit auto-inclusion in groups with matching metadata. - config.shared_context_metadata_behavior = :apply_to_host_groups - -# The settings below are suggested to provide a good initial experience -# with RSpec, but feel free to customize to your heart's content. -=begin - # This allows you to limit a spec run to individual examples or groups - # you care about by tagging them with `:focus` metadata. When nothing - # is tagged with `:focus`, all examples get run. RSpec also provides - # aliases for `it`, `describe`, and `context` that include `:focus` - # metadata: `fit`, `fdescribe` and `fcontext`, respectively. - config.filter_run_when_matching :focus - - # Allows RSpec to persist some state between runs in order to support - # the `--only-failures` and `--next-failure` CLI options. We recommend - # you configure your source control system to ignore this file. - config.example_status_persistence_file_path = "spec/examples.txt" - - # Limits the available syntax to the non-monkey patched syntax that is - # recommended. For more details, see: - # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/ - # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ - # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode - config.disable_monkey_patching! - - # Many RSpec users commonly either run the entire suite or an individual - # file, and it's useful to allow more verbose output when running an - # individual spec file. - if config.files_to_run.one? - # Use the documentation formatter for detailed output, - # unless a formatter has already been configured - # (e.g. via a command-line flag). - config.default_formatter = "doc" - end - - # Print the 10 slowest examples and example groups at the - # end of the spec run, to help surface which specs are running - # particularly slow. - config.profile_examples = 10 - - # Run specs in random order to surface order dependencies. If you find an - # order dependency and want to debug it, you can fix the order by providing - # the seed, which is printed after each run. - # --seed 1234 - config.order = :random - - # Seed global randomization in this process using the `--seed` CLI option. - # Setting this allows you to use `--seed` to deterministically reproduce - # test failures related to randomization by passing the same `--seed` value - # as the one that triggered the failure. - Kernel.srand config.seed -=end -end +# This file was generated by the `rails generate rspec:install` command. Conventionally, all +# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`. +# The generated `.rspec` file contains `--require spec_helper` which will cause +# this file to always be loaded, without a need to explicitly require it in any +# files. +# +# Given that it is always loaded, you are encouraged to keep this file as +# light-weight as possible. Requiring heavyweight dependencies from this file +# will add to the boot time of your test suite on EVERY test run, even for an +# individual file that may not need all of that loaded. Instead, consider making +# a separate helper file that requires the additional dependencies and performs +# the additional setup, and require it from the spec files that actually need +# it. +# +# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration +RSpec.configure do |config| + # rspec-expectations config goes here. You can use an alternate + # assertion/expectation library such as wrong or the stdlib/minitest + # assertions if you prefer. + config.expect_with :rspec do |expectations| + # This option will default to `true` in RSpec 4. It makes the `description` + # and `failure_message` of custom matchers include text for helper methods + # defined using `chain`, e.g.: + # be_bigger_than(2).and_smaller_than(4).description + # # => "be bigger than 2 and smaller than 4" + # ...rather than: + # # => "be bigger than 2" + expectations.include_chain_clauses_in_custom_matcher_descriptions = true + end + + # rspec-mocks config goes here. You can use an alternate test double + # library (such as bogus or mocha) by changing the `mock_with` option here. + config.mock_with :rspec do |mocks| + # Prevents you from mocking or stubbing a method that does not exist on + # a real object. This is generally recommended, and will default to + # `true` in RSpec 4. + mocks.verify_partial_doubles = true + end + + # This option will default to `:apply_to_host_groups` in RSpec 4 (and will + # have no way to turn it off -- the option exists only for backwards + # compatibility in RSpec 3). It causes shared context metadata to be + # inherited by the metadata hash of host groups and examples, rather than + # triggering implicit auto-inclusion in groups with matching metadata. + config.shared_context_metadata_behavior = :apply_to_host_groups + +# The settings below are suggested to provide a good initial experience +# with RSpec, but feel free to customize to your heart's content. +=begin + # This allows you to limit a spec run to individual examples or groups + # you care about by tagging them with `:focus` metadata. When nothing + # is tagged with `:focus`, all examples get run. RSpec also provides + # aliases for `it`, `describe`, and `context` that include `:focus` + # metadata: `fit`, `fdescribe` and `fcontext`, respectively. + config.filter_run_when_matching :focus + + # Allows RSpec to persist some state between runs in order to support + # the `--only-failures` and `--next-failure` CLI options. We recommend + # you configure your source control system to ignore this file. + config.example_status_persistence_file_path = "spec/examples.txt" + + # Limits the available syntax to the non-monkey patched syntax that is + # recommended. For more details, see: + # - http://rspec.info/blog/2012/06/rspecs-new-expectation-syntax/ + # - http://www.teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ + # - http://rspec.info/blog/2014/05/notable-changes-in-rspec-3/#zero-monkey-patching-mode + config.disable_monkey_patching! + + # This setting enables warnings. It's recommended, but in some cases may + # be too noisy due to issues in dependencies. + config.warnings = true + + # Many RSpec users commonly either run the entire suite or an individual + # file, and it's useful to allow more verbose output when running an + # individual spec file. + if config.files_to_run.one? + # Use the documentation formatter for detailed output, + # unless a formatter has already been configured + # (e.g. via a command-line flag). + config.default_formatter = "doc" + end + + # Print the 10 slowest examples and example groups at the + # end of the spec run, to help surface which specs are running + # particularly slow. + config.profile_examples = 10 + + # Run specs in random order to surface order dependencies. If you find an + # order dependency and want to debug it, you can fix the order by providing + # the seed, which is printed after each run. + # --seed 1234 + config.order = :random + + # Seed global randomization in this process using the `--seed` CLI option. + # Setting this allows you to use `--seed` to deterministically reproduce + # test failures related to randomization by passing the same `--seed` value + # as the one that triggered the failure. + Kernel.srand config.seed +=end +end diff --git a/sprint_1-Grupo_1.md b/sprint_1-Grupo_1.md new file mode 100644 index 00000000..40e8779b --- /dev/null +++ b/sprint_1-Grupo_1.md @@ -0,0 +1,53 @@ +# GRUPO 1 + +* Carlos Eduardo de Sousa - 160057701 +* Edilton Costa Alves - 170002365 +* Eduardo Vaz Fagundes Rech - 180075161 +* Estevam Galvão Albuquerque - 160005663 +* Kalley Wilkerson Rodrigues Alexandre - 170038050 + + +## NOME DO PROJETO +#### Calendário de atividades - secretaria-ppgi + +## ESCOPO DO PROJETO +* Teste para cadastro de atividade e seu prazo de execução; +* Teste para inclusão de pessoas interessadas em cada atividade; +* Teste para notificação de pessoas interessadas; +* Teste para visualização de atividades cadastradas; +* Teste para visualização de atividades de interesse. + + +## ATRIBUIÇÕES +### Scrum Master +#### Kalley Wilkerson Rodrigues Alexandre - 170038050 + +### Product Owner +#### Edilton Costa Alves - 170002365 + +### Arquivo Markdown +#### Carlos Eduardo de Sousa - 160057701 + +### Funcionalidades desenvolvidas, regras de negócio e responsáveis para cada funcionalidade e Pontuação das histórias de usuários. +. +#### 36 (Pontuação: 1) - Como um administrador, para que eu tenha controle das atividades, eu gostaria de cadastrar uma nova atividade e seu prazo de execução +#### Responsável - Kalley Wilkerson Rodrigues Alexandre - 170038050 + +#### 37 (Pontuação: 2) - Como um administrador, para que eu possa informar a comunidade, eu gostaria de adicionar pessoas interessadas em cada atividade +#### Responsável - Eduardo Vaz Fagundes Rech - 180075161 + +#### 38 (Pontuação: 2) - Como um administrador, para que eu possa notificar as pessoas interessadas em alguma atividade, eu gostaria de notificar as pessoas interessadas +#### Responsável - Estevam Galvão Albuquerque - 160005663 + +#### 39 (Pontuação: 1) - Como um usuário, para que eu possa me informar, eu gostaria de ver as atividades cadastradas +#### Responsável - Edilton Costa Alves - 170002365 + +#### 40 (Pontuação: 2) - Como um usuário, para que eu possa me informar, eu gostaria de ver as atividades que eu demonstrei interesse +#### Responsável - Carlos Eduardo de Sousa - 160057701 + + + + + + +