We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cc06e42 commit 7051f15Copy full SHA for 7051f15
1 file changed
spec/features/stories_manage_spec.rb
@@ -68,6 +68,17 @@
68
expect(page).to have_content "Story updated!"
69
end
70
71
+ it "alerts me when I try to navigate away from the page without saving my edits", js: true do
72
+ visit project_path(id: project.id)
73
+ click_button "More actions"
74
+ click_link "Edit"
75
+ fill_in "story[title]", with: "As a user, I want to edit stories"
76
+ click_link "Back"
77
+ alert_text = page.driver.browser.switch_to.alert.text
78
+
79
+ expect(alert_text).to eq "You have unsaved changes. Are you sure you want to go back?"
80
+ end
81
82
it "allows me to delete a story" do
83
visit project_path(id: project.id)
84
0 commit comments