File tree Expand file tree Collapse file tree 4 files changed +11
-10
lines changed
Expand file tree Collapse file tree 4 files changed +11
-10
lines changed Original file line number Diff line number Diff line change 6464 include_examples "Validation errors displaying"
6565 end
6666 end
67-
68- context "when from classic page" , page : :classic do
69- click_link "New Comment"
70-
71- include_examples "New Comment Submission" , false
72- end
7367end
Original file line number Diff line number Diff line change 44require "system/shared/contexts"
55
66describe "Destroy a comment" , existing_comment : true do
7- context "when from classic page" , page : :classic do
7+ context "when from classic page" do
88 let ( :comment ) { Comment . first }
99
1010 it "clicking destroy link destroys comment" do
11+ include_examples "when from classic page"
1112 accept_confirm do
1213 click_link "Destroy" , href : comment_path ( comment )
1314 end
Original file line number Diff line number Diff line change 77describe "Edit a comment" , existing_comment : true do
88 let ( :comment ) { Comment . first }
99
10- context "when from classic page" , page : :classic do
10+ context "when from classic page" do
1111 it "comment is updated when edit is submitted" do
12+ include_examples "when from classic page"
1213 click_link "Edit" , match : :first
1314 let ( :edited_name ) { "Abraham Lincoln" }
1415
1819 end
1920
2021 it "comment is not updated when edit is submitted with blank fields" , blank_form_submitted : true do
22+ include_examples "when from classic page"
2123 click_link "Edit" , match : :first
2224 expect ( page ) . not_to have_success_message
2325 expect ( page ) . to have_failure_message
Original file line number Diff line number Diff line change 6464 end
6565end
6666
67-
68-
6967# Forms
7068shared_examples "with Inline Form" do
7169 click_link "Inline Form"
9189shared_examples "when Form Submitted with Blank Fields" , blank_form_submitted : true do
9290 include_context "Form Submitted" , name : "" , text : ""
9391end
92+
93+ shared_examples "when from classic page" do
94+ click_link "New Comment"
95+
96+ include_examples "New Comment Submission" , false
97+ end
You can’t perform that action at this time.
0 commit comments