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 64
64
include_examples "Validation errors displaying"
65
65
end
66
66
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
73
67
end
Original file line number Diff line number Diff line change 4
4
require "system/shared/contexts"
5
5
6
6
describe "Destroy a comment" , existing_comment : true do
7
- context "when from classic page" , page : :classic do
7
+ context "when from classic page" do
8
8
let ( :comment ) { Comment . first }
9
9
10
10
it "clicking destroy link destroys comment" do
11
+ include_examples "when from classic page"
11
12
accept_confirm do
12
13
click_link "Destroy" , href : comment_path ( comment )
13
14
end
Original file line number Diff line number Diff line change 7
7
describe "Edit a comment" , existing_comment : true do
8
8
let ( :comment ) { Comment . first }
9
9
10
- context "when from classic page" , page : :classic do
10
+ context "when from classic page" do
11
11
it "comment is updated when edit is submitted" do
12
+ include_examples "when from classic page"
12
13
click_link "Edit" , match : :first
13
14
let ( :edited_name ) { "Abraham Lincoln" }
14
15
18
19
end
19
20
20
21
it "comment is not updated when edit is submitted with blank fields" , blank_form_submitted : true do
22
+ include_examples "when from classic page"
21
23
click_link "Edit" , match : :first
22
24
expect ( page ) . not_to have_success_message
23
25
expect ( page ) . to have_failure_message
Original file line number Diff line number Diff line change 64
64
end
65
65
end
66
66
67
-
68
-
69
67
# Forms
70
68
shared_examples "with Inline Form" do
71
69
click_link "Inline Form"
91
89
shared_examples "when Form Submitted with Blank Fields" , blank_form_submitted : true do
92
90
include_context "Form Submitted" , name : "" , text : ""
93
91
end
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