From 9cff2ac56b7581d6c70737bee7c8b0ab02bb30c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Tue, 25 Jun 2019 18:11:41 +0200 Subject: [PATCH] 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. --- spec/shared/features/notifiable_in_app.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/shared/features/notifiable_in_app.rb b/spec/shared/features/notifiable_in_app.rb index 4010fa2ca..08ca37e71 100644 --- a/spec/shared/features/notifiable_in_app.rb +++ b/spec/shared/features/notifiable_in_app.rb @@ -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