Skip to content

Commit b101ad7

Browse files
committed
DT-340: Edit tests so that it tests all scenarios
1 parent 7b5afd6 commit b101ad7

1 file changed

Lines changed: 18 additions & 3 deletions

File tree

spec/features/stories_manage_spec.rb

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,26 @@
7272
visit project_path(id: project.id)
7373
click_button "More actions"
7474
click_link "Edit"
75-
fill_in "story[title]", with: "As a user, I want to edit stories"
75+
7676
click_link "Back"
77-
alert_text = page.driver.browser.switch_to.alert.text
77+
assert_current_path project_path(id: project.id)
78+
79+
click_button "More actions"
80+
click_link "Edit"
81+
82+
fill_in "story[title]", with: "As a user, I want to edit stories"
83+
84+
dismiss_confirm("You have unsaved changes. Are you sure you want to go back?") do
85+
find("#logo").click
86+
end
87+
88+
assert_current_path edit_project_story_path(project, story)
89+
90+
accept_confirm("You have unsaved changes. Are you sure you want to go back?") do
91+
click_link "Back"
92+
end
7893

79-
expect(alert_text).to eq "You have unsaved changes. Are you sure you want to go back?"
94+
assert_current_path project_path(id: project.id)
8095
end
8196

8297
it "allows me to delete a story" do

0 commit comments

Comments
 (0)