Improve expectations in notifiable specs

Sometimes during this test some comments are not created (so far we
don't know why), but since all comments had the same text, we didn't
notice when checking the text of the comment was on the page.
This commit is contained in:
Javi Martín
2019-06-25 18:11:41 +02:00
parent 79852716f2
commit 9cff2ac56b

View File

@@ -25,15 +25,15 @@ shared_examples "notifiable in-app" do |described_class|
end
scenario "Multiple users commented on my notifiable", :js do
3.times do
3.times do |n|
login_as(create(:user, :verified))
visit path_for(notifiable)
fill_in comment_body(notifiable), with: "I agree"
fill_in comment_body(notifiable), with: "Number #{n + 1} is the best!"
click_button "publish_comment"
within "#comments" do
expect(page).to have_content "I agree"
expect(page).to have_content "Number #{n + 1} is the best!"
end
logout
end