diff --git a/spec/system/admin/admin_notifications_spec.rb b/spec/system/admin/admin_notifications_spec.rb index 9a3adaf49..e6c2be180 100644 --- a/spec/system/admin/admin_notifications_spec.rb +++ b/spec/system/admin/admin_notifications_spec.rb @@ -215,15 +215,14 @@ describe "Admin Notifications", :admin do end scenario "Select list of users to send notification" do - UserSegments.segments.each do |segment| - segment_recipient = UserSegments.segment_name(segment) + segment = UserSegments.segments.sample + segment_recipient = UserSegments.segment_name(segment) - visit new_admin_admin_notification_path + visit new_admin_admin_notification_path - fill_in_admin_notification_form(segment_recipient: segment_recipient) - click_button "Create notification" + fill_in_admin_notification_form(segment_recipient: segment_recipient) + click_button "Create notification" - expect(page).to have_content segment_recipient - end + expect(page).to have_content segment_recipient end end diff --git a/spec/system/admin/emails/newsletters_spec.rb b/spec/system/admin/emails/newsletters_spec.rb index 1dcbaf4c5..ad09ed149 100644 --- a/spec/system/admin/emails/newsletters_spec.rb +++ b/spec/system/admin/emails/newsletters_spec.rb @@ -162,16 +162,15 @@ describe "Admin newsletter emails", :admin do describe "Select list of users to send newsletter" do scenario "Custom user segments" do - UserSegments.segments.each do |segment| - segment_recipient = UserSegments.segment_name(segment) + segment = UserSegments.segments.sample + segment_recipient = UserSegments.segment_name(segment) - visit new_admin_newsletter_path + visit new_admin_newsletter_path - fill_in_newsletter_form(segment_recipient: segment_recipient) - click_button "Create Newsletter" + fill_in_newsletter_form(segment_recipient: segment_recipient) + click_button "Create Newsletter" - expect(page).to have_content segment_recipient - end + expect(page).to have_content segment_recipient end scenario "Geozone segments" do