Skip to content

Commit 0c81396

Browse files
committed
page => subject
1 parent 2d62318 commit 0c81396

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

spec/system/shared/contexts.rb

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,25 @@
2222
end
2323

2424
shared_examples "check if comment is added" do |expect_comment_count|
25-
expect(page).to have_css(".js-comment-author", text: name)
26-
expect(page).to have_css(".js-comment-text", text: text)
27-
expect(page).to have_no_content("Your comment was not saved!")
25+
expect(subject).to have_css(".js-comment-author", text: name)
26+
expect(subject).to have_css(".js-comment-text", text: text)
27+
expect(subject).to have_no_content("Your comment was not saved!")
2828
if expect_comment_count
29-
expect(page).to have_css("#js-comment-count",
29+
expect(subject).to have_css("#js-comment-count",
3030
text: "Comments: #{Comment.count}")
3131
end
3232
end
3333

3434
shared_examples "expect failed validation" do
35-
expect(page).to have_content("Your comment was not saved!")
36-
expect(page).to have_content("Author: can't be blank")
37-
expect(page).to have_content("Text: can't be blank")
35+
expect(subject).to have_content("Your comment was not saved!")
36+
expect(subject).to have_content("Author: can't be blank")
37+
expect(subject).to have_content("Text: can't be blank")
3838
end
3939

4040
shared_examples "expect successful validation" do
41-
expect(page).to have_no_content("Your comment was not saved!")
42-
expect(page).to have_no_content("Author: can't be blank")
43-
expect(page).to have_no_content("Text: can't be blank")
41+
expect(subject).to have_no_content("Your comment was not saved!")
42+
expect(subject).to have_no_content("Author: can't be blank")
43+
expect(subject).to have_no_content("Text: can't be blank")
4444
end
4545

4646
# Form Submission

0 commit comments

Comments
 (0)