From 226d9021274da729448a5a68ec6f327afc24121d Mon Sep 17 00:00:00 2001 From: Reinier Balt Date: Tue, 2 Feb 2010 23:43:18 +0100 Subject: [PATCH] consume confirmation dialog when deleting note --- features/notes_manage.feature | 16 ++++++---------- features/step_definitions/generic_steps.rb | 1 + features/step_definitions/note_steps.rb | 1 + 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/features/notes_manage.feature b/features/notes_manage.feature index 5ed5cbf7..b1488831 100644 --- a/features/notes_manage.feature +++ b/features/notes_manage.feature @@ -8,17 +8,16 @@ Feature: View, add, remove notes Given the following user record | login | password | is_admin | | testuser | secret | false | + And I have logged in as "testuser" with password "secret" Scenario: View notes - Given I have logged in as "testuser" with password "secret" - And I have two projects with one note each + Given I have two projects with one note each When I go to the notes page Then 2 notes should be visible And the badge should show 2 Scenario: Add a new note - Given I have logged in as "testuser" with password "secret" - And I have one project "Pass Final Exam" with no notes + Given I have one project "Pass Final Exam" with no notes When I add note "My Note A" from the "Pass Final Exam" project page Then I should see note "My Note A" on the "Pass Final Exam" project page And I should see note "My Note A" on the notes page @@ -26,8 +25,7 @@ Feature: View, add, remove notes @selenium Scenario: Delete note from notes page - Given I have logged in as "testuser" with password "secret" - And I have a project "Pass Final Exam" with 2 notes + Given I have a project "Pass Final Exam" with 2 notes When I go to the notes page And I delete the first note Then the first note should disappear @@ -35,16 +33,14 @@ Feature: View, add, remove notes @selenium Scenario: Link to note - Given I have logged in as "testuser" with password "secret" - And I have a project "Pass Final Exam" with 1 note + Given I have a project "Pass Final Exam" with 1 note When I visit the "Pass Final Exam" project And I click the icon next to the note Then I should see the note text @selenium Scenario: Toggle notes - Given I have logged in as "testuser" with password "secret" - And I have two projects with one note each + Given I have two projects with one note each When I go to the notes page And I click Toggle Notes Then I should see the body of the notes diff --git a/features/step_definitions/generic_steps.rb b/features/step_definitions/generic_steps.rb index 1ef65177..4d1bea16 100644 --- a/features/step_definitions/generic_steps.rb +++ b/features/step_definitions/generic_steps.rb @@ -1,4 +1,5 @@ Then /the badge should show (.*)/ do |number| + # puts response.body.inspect badge = -1 response.should have_xpath("//span[@id='badge_count']") do |node| badge = node.first.content.to_i diff --git a/features/step_definitions/note_steps.rb b/features/step_definitions/note_steps.rb index 5f8b6a87..b9ad279d 100644 --- a/features/step_definitions/note_steps.rb +++ b/features/step_definitions/note_steps.rb @@ -45,6 +45,7 @@ end When /^I delete the first note$/ do click_link "delete note" + selenium.get_confirmation.should == "Are you sure that you want to delete the note '1'?" end Then /^the first note should disappear$/ do