From ea5cee1d887fe18e55a06431f0f229c28b2220c7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 27 Feb 2020 11:32:56 +0000 Subject: [PATCH 01/22] Bump nokogiri from 1.10.5 to 1.10.8 Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.10.5 to 1.10.8. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/master/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.10.5...v1.10.8) Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 1c0f8f1e..8a72efd2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -133,7 +133,7 @@ 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) From 19ead50285f3c657c4a9b7cf174341537eb26c20 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 6 Jun 2020 04:42:08 +0000 Subject: [PATCH 02/22] Bump websocket-extensions from 0.1.4 to 0.1.5 Bumps [websocket-extensions](https://github.com/faye/websocket-extensions-ruby) from 0.1.4 to 0.1.5. - [Release notes](https://github.com/faye/websocket-extensions-ruby/releases) - [Changelog](https://github.com/faye/websocket-extensions-ruby/blob/master/CHANGELOG.md) - [Commits](https://github.com/faye/websocket-extensions-ruby/compare/0.1.4...0.1.5) Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 1c0f8f1e..81ec2551 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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) From cd08b95a52a82784738a5fc9b2e0fab5f365fb00 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 Jun 2020 08:18:53 +0000 Subject: [PATCH 03/22] Bump rack from 2.0.7 to 2.2.3 Bumps [rack](https://github.com/rack/rack) from 2.0.7 to 2.2.3. - [Release notes](https://github.com/rack/rack/releases) - [Changelog](https://github.com/rack/rack/blob/master/CHANGELOG.md) - [Commits](https://github.com/rack/rack/compare/2.0.7...2.2.3) Signed-off-by: dependabot[bot] --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 1c0f8f1e..a40c3067 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -139,7 +139,7 @@ GEM pg (1.1.4) public_suffix (4.0.1) puma (3.12.1) - rack (2.0.7) + rack (2.2.3) rack-test (1.1.0) rack (>= 1.0, < 3) rails (5.2.3) From 8d75616c5d7c45032a2a95c1cdf5ea17318f46f7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 24 Sep 2020 17:04:51 +0000 Subject: [PATCH 04/22] Bump puma from 3.12.1 to 3.12.6 Bumps [puma](https://github.com/puma/puma) from 3.12.1 to 3.12.6. - [Release notes](https://github.com/puma/puma/releases) - [Changelog](https://github.com/puma/puma/blob/master/History.md) - [Commits](https://github.com/puma/puma/compare/v3.12.1...v3.12.6) Signed-off-by: dependabot[bot] --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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 a40c3067..48b22748 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -138,7 +138,7 @@ GEM orm_adapter (0.5.0) pg (1.1.4) public_suffix (4.0.1) - puma (3.12.1) + puma (3.12.6) rack (2.2.3) rack-test (1.1.0) rack (>= 1.0, < 3) @@ -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) From 14bfca1c8a33f7416fd27c1c7fb319af70ef9810 Mon Sep 17 00:00:00 2001 From: kdusousa Date: Wed, 28 Oct 2020 13:35:55 -0300 Subject: [PATCH 05/22] Create sprint_1-Grupo_1.md --- sprint_1-Grupo_1.md | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 sprint_1-Grupo_1.md diff --git a/sprint_1-Grupo_1.md b/sprint_1-Grupo_1.md new file mode 100644 index 00000000..1aca4c44 --- /dev/null +++ b/sprint_1-Grupo_1.md @@ -0,0 +1,38 @@ +# 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 +#### TEXTO + +## 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. +####texto + +### Pontuação das histórias de usuários. + + + + From 395e30cb62f824a93dcbc72ee9d04e77a6319d30 Mon Sep 17 00:00:00 2001 From: Kalley Wilkerson Date: Wed, 28 Oct 2020 15:07:23 -0300 Subject: [PATCH 06/22] Adicionados primeiros testes com cucumber de capybara --- features/addAtividade.feature | 16 ++++++++++++++++ features/step_definitions/atividade_steps.rb | 19 +++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 features/addAtividade.feature create mode 100644 features/step_definitions/atividade_steps.rb diff --git a/features/addAtividade.feature b/features/addAtividade.feature new file mode 100644 index 00000000..383f63e9 --- /dev/null +++ b/features/addAtividade.feature @@ -0,0 +1,16 @@ +#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 + 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 "Nome" 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" diff --git a/features/step_definitions/atividade_steps.rb b/features/step_definitions/atividade_steps.rb new file mode 100644 index 00000000..3ee77581 --- /dev/null +++ b/features/step_definitions/atividade_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 From 355a0fa630d857c23a9e96c039a330dfdf285abf Mon Sep 17 00:00:00 2001 From: MrJamesX37 <47198738+MrJamesX37@users.noreply.github.com> Date: Wed, 28 Oct 2020 17:54:30 -0300 Subject: [PATCH 07/22] Adicionado primeiros testes da issue #37 --- features/add_person_on_a_activite.feature | 11 +++++++++++ .../add_person_on_activite_steps.rb | 15 +++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 features/add_person_on_a_activite.feature create mode 100644 features/step_definitions/add_person_on_activite_steps.rb diff --git a/features/add_person_on_a_activite.feature b/features/add_person_on_a_activite.feature new file mode 100644 index 00000000..20a65812 --- /dev/null +++ b/features/add_person_on_a_activite.feature @@ -0,0 +1,11 @@ +#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: Adicionar pessoa em atividade + Dado que estou na página "Atividades" + Quando eu clico em "Adicionar pessoa interessada" + Então eu devo ser redirecionado para "Atividades" + E eu devo ver "Pessoa adicionada à atividade com sucesso" \ No newline at end of file diff --git a/features/step_definitions/add_person_on_activite_steps.rb b/features/step_definitions/add_person_on_activite_steps.rb new file mode 100644 index 00000000..1db6195d --- /dev/null +++ b/features/step_definitions/add_person_on_activite_steps.rb @@ -0,0 +1,15 @@ +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 + +E("eu devo ver {string}") do |string| + expect(page).to have_content string +end \ No newline at end of file From 0886ecfa9f47a8698b4df0fa42479e03d8297d52 Mon Sep 17 00:00:00 2001 From: MrJamesX37 <47198738+MrJamesX37@users.noreply.github.com> Date: Wed, 28 Oct 2020 18:59:29 -0300 Subject: [PATCH 08/22] Update nos testes --- features/addPersonOnActivite.feature | 11 +++++++++++ .../step_definitions/addPersonOnActivite_steps.rb | 15 +++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 features/addPersonOnActivite.feature create mode 100644 features/step_definitions/addPersonOnActivite_steps.rb diff --git a/features/addPersonOnActivite.feature b/features/addPersonOnActivite.feature new file mode 100644 index 00000000..20a65812 --- /dev/null +++ b/features/addPersonOnActivite.feature @@ -0,0 +1,11 @@ +#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: Adicionar pessoa em atividade + Dado que estou na página "Atividades" + Quando eu clico em "Adicionar pessoa interessada" + Então eu devo ser redirecionado para "Atividades" + E eu devo ver "Pessoa adicionada à atividade com sucesso" \ 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..1db6195d --- /dev/null +++ b/features/step_definitions/addPersonOnActivite_steps.rb @@ -0,0 +1,15 @@ +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 + +E("eu devo ver {string}") do |string| + expect(page).to have_content string +end \ No newline at end of file From 9a1e9cf26eea97453a81216f4c5738d6b3115468 Mon Sep 17 00:00:00 2001 From: MrJamesX37 <47198738+MrJamesX37@users.noreply.github.com> Date: Wed, 28 Oct 2020 19:00:05 -0300 Subject: [PATCH 09/22] Delete add_person_on_activite_steps.rb --- .../add_person_on_activite_steps.rb | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 features/step_definitions/add_person_on_activite_steps.rb diff --git a/features/step_definitions/add_person_on_activite_steps.rb b/features/step_definitions/add_person_on_activite_steps.rb deleted file mode 100644 index 1db6195d..00000000 --- a/features/step_definitions/add_person_on_activite_steps.rb +++ /dev/null @@ -1,15 +0,0 @@ -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 - -E("eu devo ver {string}") do |string| - expect(page).to have_content string -end \ No newline at end of file From edce627cd638c6469a7d357621d8c54e2f2f8f8e Mon Sep 17 00:00:00 2001 From: MrJamesX37 <47198738+MrJamesX37@users.noreply.github.com> Date: Wed, 28 Oct 2020 19:00:18 -0300 Subject: [PATCH 10/22] Delete add_person_on_a_activite.feature --- features/add_person_on_a_activite.feature | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 features/add_person_on_a_activite.feature diff --git a/features/add_person_on_a_activite.feature b/features/add_person_on_a_activite.feature deleted file mode 100644 index 20a65812..00000000 --- a/features/add_person_on_a_activite.feature +++ /dev/null @@ -1,11 +0,0 @@ -#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: Adicionar pessoa em atividade - Dado que estou na página "Atividades" - Quando eu clico em "Adicionar pessoa interessada" - Então eu devo ser redirecionado para "Atividades" - E eu devo ver "Pessoa adicionada à atividade com sucesso" \ No newline at end of file From be323ed5710b87ff74d4dc79370f296ee9d2c11b Mon Sep 17 00:00:00 2001 From: MrJamesX37 <47198738+MrJamesX37@users.noreply.github.com> Date: Wed, 28 Oct 2020 19:02:58 -0300 Subject: [PATCH 11/22] Update nos testes da issue #37 --- features/step_definitions/addPersonOnActivite_steps.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/step_definitions/addPersonOnActivite_steps.rb b/features/step_definitions/addPersonOnActivite_steps.rb index 1db6195d..83f2e68e 100644 --- a/features/step_definitions/addPersonOnActivite_steps.rb +++ b/features/step_definitions/addPersonOnActivite_steps.rb @@ -1,5 +1,5 @@ Dado("que estou na página {string}") do |string| - visit "localhost:3000/#{string.downcase}" + redirect_to "localhost:3000/#{string.downcase}" end Quando("eu clico em {string}") do |string| @@ -7,7 +7,7 @@ end Então("eu devo ser redirecionado para {string}") do |string| - visit "localhost:3000/#{string.downcase}" + redirect_to "localhost:3000/#{string.downcase}" end E("eu devo ver {string}") do |string| From bf5f0bc109705a89da0a3366669d8165ed8a6b3a Mon Sep 17 00:00:00 2001 From: MrJamesX37 <47198738+MrJamesX37@users.noreply.github.com> Date: Thu, 29 Oct 2020 09:36:32 -0300 Subject: [PATCH 12/22] =?UTF-8?q?Criado=20cen=C3=A1rio=20feliz=20e=20trist?= =?UTF-8?q?e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- features/addPersonOnActivite.feature | 19 ++++++++++++++----- .../addPersonOnActivite_steps.rb | 3 +++ 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/features/addPersonOnActivite.feature b/features/addPersonOnActivite.feature index 20a65812..6a968175 100644 --- a/features/addPersonOnActivite.feature +++ b/features/addPersonOnActivite.feature @@ -4,8 +4,17 @@ 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: Adicionar pessoa em atividade - Dado que estou na página "Atividades" - Quando eu clico em "Adicionar pessoa interessada" - Então eu devo ser redirecionado para "Atividades" - E eu devo ver "Pessoa adicionada à atividade com sucesso" \ No newline at end of file + # Cenário Feliz + Cenário: Adicionar pessoa em atividade + Dado que estou na página "Atividades" + Quando eu clico em "Adicionar pessoa interessada" + Então eu devo ser redirecionado para "Atividades" + E eu devo ver "Pessoa adicionada à atividade com sucesso" + + # Cenário Triste + Cenário: Adicionar pessoa já cadastrada em atividade + Dado que estou na página "Atividades" + Quando eu clico em "Adicionar pessoa interessada" + E essa pessoa já está cadastrada nessa atividade + Então eu devo ser redirecionado para "Atividades" + E eu devo ver "Pessoa já está nessa atividade" \ No newline at end of file diff --git a/features/step_definitions/addPersonOnActivite_steps.rb b/features/step_definitions/addPersonOnActivite_steps.rb index 83f2e68e..8b72da80 100644 --- a/features/step_definitions/addPersonOnActivite_steps.rb +++ b/features/step_definitions/addPersonOnActivite_steps.rb @@ -12,4 +12,7 @@ E("eu devo ver {string}") do |string| expect(page).to have_content string +end + +E("essa pessoa já está cadastrada nessa atividade") do |string| end \ No newline at end of file From 884583975ba1736c92917bd50fe4dbefbbcf7124 Mon Sep 17 00:00:00 2001 From: MrJamesX37 <47198738+MrJamesX37@users.noreply.github.com> Date: Thu, 29 Oct 2020 12:21:45 -0300 Subject: [PATCH 13/22] =?UTF-8?q?Adicionado=20testes=20unit=C3=A1rios=20da?= =?UTF-8?q?=20issue=20#37?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- features/addPersonOnActivite.feature | 14 +- .../addPersonOnActivite_steps.rb | 11 +- spec/addPersonOnActivite_spec.rb | 19 ++ spec/spec_helper.rb | 196 +++++++++--------- 4 files changed, 133 insertions(+), 107 deletions(-) create mode 100644 spec/addPersonOnActivite_spec.rb diff --git a/features/addPersonOnActivite.feature b/features/addPersonOnActivite.feature index 6a968175..d9233035 100644 --- a/features/addPersonOnActivite.feature +++ b/features/addPersonOnActivite.feature @@ -7,14 +7,16 @@ Funcionalidade: Usuário pode adicionar pessoa interessada em uma atividade # Cenário Feliz Cenário: Adicionar pessoa em atividade Dado que estou na página "Atividades" - Quando eu clico em "Adicionar pessoa interessada" + 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: Adicionar pessoa já cadastrada em atividade + #Cenário Triste + Cenário: Página não encontrada Dado que estou na página "Atividades" Quando eu clico em "Adicionar pessoa interessada" - E essa pessoa já está cadastrada nessa atividade - Então eu devo ser redirecionado para "Atividades" - E eu devo ver "Pessoa já está nessa atividade" \ No newline at end of file + 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/step_definitions/addPersonOnActivite_steps.rb b/features/step_definitions/addPersonOnActivite_steps.rb index 8b72da80..90ca5e27 100644 --- a/features/step_definitions/addPersonOnActivite_steps.rb +++ b/features/step_definitions/addPersonOnActivite_steps.rb @@ -1,5 +1,5 @@ Dado("que estou na página {string}") do |string| - redirect_to "localhost:3000/#{string.downcase}" + visit "localhost:3000/#{string.downcase}" end Quando("eu clico em {string}") do |string| @@ -7,12 +7,13 @@ end Então("eu devo ser redirecionado para {string}") do |string| - redirect_to "localhost:3000/#{string.downcase}" + 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 - -E("essa pessoa já está cadastrada nessa atividade") do |string| end \ No newline at end of file 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/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 From 68db7508ac4fb301cdbf773c11959f3e10e3d950 Mon Sep 17 00:00:00 2001 From: Kalley Wilkerson Date: Fri, 30 Oct 2020 08:58:55 -0300 Subject: [PATCH 14/22] =?UTF-8?q?Adicionados=20alguns=20testes=20e=20espec?= =?UTF-8?q?ifica=C3=A7=C3=B5es=20de=20testes=20simples=20N=C3=A3o=20criei?= =?UTF-8?q?=20com=20mais=20detalhes=20quanto=20ao=20controlador=20pois=20e?= =?UTF-8?q?le=20ainda=20n=C3=A3o=20existe=20e=20essa=20sprint=20era=20apen?= =?UTF-8?q?as=20para=20especificar=20os=20testes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...dAtividade.feature => addActivity.feature} | 12 ++++++++++-- ...tividade_steps.rb => addActivity_steps.rb} | 0 .../controllers/activities_controller_spec.rb | 19 +++++++++++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) rename features/{addAtividade.feature => addActivity.feature} (54%) rename features/step_definitions/{atividade_steps.rb => addActivity_steps.rb} (100%) create mode 100644 spec/controllers/activities_controller_spec.rb diff --git a/features/addAtividade.feature b/features/addActivity.feature similarity index 54% rename from features/addAtividade.feature rename to features/addActivity.feature index 383f63e9..fedd6cdd 100644 --- a/features/addAtividade.feature +++ b/features/addActivity.feature @@ -5,12 +5,20 @@ 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 +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 "Nome" com "Teste" + 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/step_definitions/atividade_steps.rb b/features/step_definitions/addActivity_steps.rb similarity index 100% rename from features/step_definitions/atividade_steps.rb rename to features/step_definitions/addActivity_steps.rb 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 From 957daa94f72b0b39ce23449b58f00d84fbcdec77 Mon Sep 17 00:00:00 2001 From: kdusousa Date: Fri, 30 Oct 2020 10:05:18 -0300 Subject: [PATCH 15/22] Create showInterestActivity --- features/showInterestActivity | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 features/showInterestActivity diff --git a/features/showInterestActivity b/features/showInterestActivity new file mode 100644 index 00000000..604fbff7 --- /dev/null +++ b/features/showInterestActivity @@ -0,0 +1,32 @@ +#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 sign up page + And I fill in 'email' with 'student@student.com' + And I fill in 'full_name' with 'alunao' + Then 'student' should be an option for 'role' + And I fill in 'password' with 'admin123' + And I fill in 'password_confirmation' with 'admin123' + When I press 'Sign up' + 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 From b05191e872513726f9c1e2a0484308512cff702d Mon Sep 17 00:00:00 2001 From: kdusousa Date: Fri, 30 Oct 2020 10:05:39 -0300 Subject: [PATCH 16/22] Rename showInterestActivity to showInterestActivity.feature --- features/{showInterestActivity => showInterestActivity.feature} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename features/{showInterestActivity => showInterestActivity.feature} (100%) diff --git a/features/showInterestActivity b/features/showInterestActivity.feature similarity index 100% rename from features/showInterestActivity rename to features/showInterestActivity.feature From b8555746dce5f23216c693446a1e6a700633c2fa Mon Sep 17 00:00:00 2001 From: kdusousa Date: Fri, 30 Oct 2020 10:34:08 -0300 Subject: [PATCH 17/22] Create showInterestActivity_steps.rb --- .../showInterestActivity_steps.rb | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 features/step_definitions/showInterestActivity_steps.rb 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 From 2236e52e129fb3eddacb6f66d54a4bb1c222f7d2 Mon Sep 17 00:00:00 2001 From: kdusousa Date: Fri, 30 Oct 2020 10:34:49 -0300 Subject: [PATCH 18/22] Update showInterestActivity.feature --- features/showInterestActivity.feature | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/features/showInterestActivity.feature b/features/showInterestActivity.feature index 604fbff7..3ffd0f55 100644 --- a/features/showInterestActivity.feature +++ b/features/showInterestActivity.feature @@ -9,13 +9,10 @@ Feature: User actions I would like to see interests activities Background: User logged in - Given I am on the sign up page + Given I am on the 'users/sign_in' page And I fill in 'email' with 'student@student.com' - And I fill in 'full_name' with 'alunao' - Then 'student' should be an option for 'role' And I fill in 'password' with 'admin123' - And I fill in 'password_confirmation' with 'admin123' - When I press 'Sign up' + When I press 'Log in' Then I should be on 'root_path' page From 3c9e22ef7436133b340545dff6ae947d69113d39 Mon Sep 17 00:00:00 2001 From: kdusousa Date: Fri, 30 Oct 2020 10:45:39 -0300 Subject: [PATCH 19/22] Create showInterestActivities_spec.rb --- spec/showInterestActivities_spec.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 spec/showInterestActivities_spec.rb 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 From a7a64210a4193b7088f6a8e6eecd35d7a2ccee1a Mon Sep 17 00:00:00 2001 From: kdusousa Date: Fri, 30 Oct 2020 10:55:06 -0300 Subject: [PATCH 20/22] Update sprint_1-Grupo_1.md --- sprint_1-Grupo_1.md | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/sprint_1-Grupo_1.md b/sprint_1-Grupo_1.md index 1aca4c44..40e8779b 100644 --- a/sprint_1-Grupo_1.md +++ b/sprint_1-Grupo_1.md @@ -8,7 +8,7 @@ ## NOME DO PROJETO -#### TEXTO +#### Calendário de atividades - secretaria-ppgi ## ESCOPO DO PROJETO * Teste para cadastro de atividade e seu prazo de execução; @@ -28,10 +28,25 @@ ### Arquivo Markdown #### Carlos Eduardo de Sousa - 160057701 -### Funcionalidades desenvolvidas, regras de negócio e responsáveis para cada funcionalidade. -####texto +### 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 + + -### Pontuação das histórias de usuários. From 4bc4927c822957fdb83177f541a8f0ea3d69fa05 Mon Sep 17 00:00:00 2001 From: Estevam Albuquerque Date: Sat, 31 Oct 2020 05:16:37 -0300 Subject: [PATCH 21/22] features and step_definitions issue 38 --- features/notifyInterestedPeople.feature | 26 +++++++++++ .../notifyInterestedPeople_step.rb | 45 +++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 features/notifyInterestedPeople.feature create mode 100644 features/step_definitions/notifyInterestedPeople_step.rb diff --git a/features/notifyInterestedPeople.feature b/features/notifyInterestedPeople.feature new file mode 100644 index 00000000..4a1273c1 --- /dev/null +++ b/features/notifyInterestedPeople.feature @@ -0,0 +1,26 @@ +#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 + + 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: 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" + +#estou contando que "Atividades" seja a página home de administração + + diff --git a/features/step_definitions/notifyInterestedPeople_step.rb b/features/step_definitions/notifyInterestedPeople_step.rb new file mode 100644 index 00000000..f337e2ec --- /dev/null +++ b/features/step_definitions/notifyInterestedPeople_step.rb @@ -0,0 +1,45 @@ +#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 +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 \ No newline at end of file From 7ee14fd025a7736b9d05e40b84bd6d2371963713 Mon Sep 17 00:00:00 2001 From: Estevam Albuquerque Date: Sun, 1 Nov 2020 20:49:40 -0300 Subject: [PATCH 22/22] adjustments and rspec file --- features/notifyInterestedPeople.feature | 9 +++++++++ .../notifyInterestedPeople_step.rb | 19 ++++++++++++++++++- spec/notifyInterestedPeople_spec.rb | 19 +++++++++++++++++++ 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 spec/notifyInterestedPeople_spec.rb diff --git a/features/notifyInterestedPeople.feature b/features/notifyInterestedPeople.feature index 4a1273c1..4dc84a40 100644 --- a/features/notifyInterestedPeople.feature +++ b/features/notifyInterestedPeople.feature @@ -6,6 +6,7 @@ Funcionalidade: Administrador notificar as pessoas interessadas 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" @@ -13,6 +14,7 @@ Funcionalidade: Administrador notificar as pessoas interessadas 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" @@ -21,6 +23,13 @@ Funcionalidade: Administrador notificar as pessoas interessadas 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/step_definitions/notifyInterestedPeople_step.rb b/features/step_definitions/notifyInterestedPeople_step.rb index f337e2ec..8ae2ebb1 100644 --- a/features/step_definitions/notifyInterestedPeople_step.rb +++ b/features/step_definitions/notifyInterestedPeople_step.rb @@ -19,7 +19,7 @@ visit "localhost:3000/#{string.downcase}" end -#Cenário +#Cenário feliz Dado("que eu estou na página {string}") do |string| visit "localhost:3000/#{string.downcase}" end @@ -40,6 +40,23 @@ 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/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