Skip to content

Commit 2a11b69

Browse files
committed
fix specsgit push
1 parent ac02a9c commit 2a11b69

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

spec/system/add_new_comment_spec.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,4 @@
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
7367
end

spec/system/destroy_comment_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
require "system/shared/contexts"
55

66
describe "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

spec/system/edit_comment_spec.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
describe "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

@@ -18,6 +19,7 @@
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

spec/system/shared/examples.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@
6464
end
6565
end
6666

67-
68-
6967
# Forms
7068
shared_examples "with Inline Form" do
7169
click_link "Inline Form"
@@ -91,3 +89,9 @@
9189
shared_examples "when Form Submitted with Blank Fields", blank_form_submitted: true do
9290
include_context "Form Submitted", name: "", text: ""
9391
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

0 commit comments

Comments
 (0)