From 435c126f4f0c3b1b89bbdc78e1ebf159b730ae3c Mon Sep 17 00:00:00 2001 From: natalypatti Date: Wed, 4 Dec 2019 00:56:20 -0300 Subject: [PATCH] delete college caminho triste --- src/app/features/delete_college.feature | 7 ++++++- .../features/delete_pages_administrator.feature | 14 +++++++------- .../step_definitions/delete_college_steps.rb | 5 +++++ 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/app/features/delete_college.feature b/src/app/features/delete_college.feature index 01c0f4b1..e2e70894 100644 --- a/src/app/features/delete_college.feature +++ b/src/app/features/delete_college.feature @@ -12,4 +12,9 @@ Scenario: Delete a college page when I go to edit page settings and click the "A Given I am on the edit page settings page When I click the Apagar a página button And I am on the colleges menu page - Then The college page shouldn't be exist anymore \ No newline at end of file + Then The college page shouldn't be exist anymore + +Scenario: User tries to delete a college that he is not admin + Given There is a college page created + And I am on the colleges menu + Then I cant find that college Editar button \ No newline at end of file diff --git a/src/app/features/delete_pages_administrator.feature b/src/app/features/delete_pages_administrator.feature index b6e771df..0adc2108 100644 --- a/src/app/features/delete_pages_administrator.feature +++ b/src/app/features/delete_pages_administrator.feature @@ -5,13 +5,13 @@ I want to delete a administrator of the page So that i can manage the page administration resposibility Background: -Given I logged in successfully -And I created a college page -And I already defined the user as administrator + Given I logged in successfully + And I created a college page + And I already defined the user as administrator Scenario: Administrator choose othe administrator to be exclude clicking on the trash buttom -Given I am on the page's list of administrators -When I click on the trash button associated with a administrator -Then I should see the list without the administrator that I choose -And I should see a success message + Given I am on the page's list of administrators + When I click on the trash button associated with a administrator + Then I should see the list without the administrator that I choose + And I should see a success message diff --git a/src/app/features/step_definitions/delete_college_steps.rb b/src/app/features/step_definitions/delete_college_steps.rb index bca530cd..0288c16c 100644 --- a/src/app/features/step_definitions/delete_college_steps.rb +++ b/src/app/features/step_definitions/delete_college_steps.rb @@ -1,3 +1,8 @@ Then(/^The college page shouldn't be exist anymore$/) do expect(page).not_to have_link('Editar', href: '/colleges/#{@college.id}/edit') +end + +Then(/^I cant find that college Editar button$/) do + element = find('.summary', text: 'UT002 - Faculdade Teste 002') + expect(element).not_to have_link('Editar') end \ No newline at end of file