Reduce number of requests in user segments tests
We were testing the creation of newsletters and admin notifications for each existing segment, which IMHO is a bit overkill, considering how slow system tests are. So far we don't have any reasons to believe creating newsletters and admin notifications will only work for some user segments, so we're testing a random one instead. Running these tests on my machine is now about 15 seconds faster.
This commit is contained in:
@@ -215,15 +215,14 @@ describe "Admin Notifications", :admin do
|
|||||||
end
|
end
|
||||||
|
|
||||||
scenario "Select list of users to send notification" do
|
scenario "Select list of users to send notification" do
|
||||||
UserSegments.segments.each do |segment|
|
segment = UserSegments.segments.sample
|
||||||
segment_recipient = UserSegments.segment_name(segment)
|
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)
|
fill_in_admin_notification_form(segment_recipient: segment_recipient)
|
||||||
click_button "Create notification"
|
click_button "Create notification"
|
||||||
|
|
||||||
expect(page).to have_content segment_recipient
|
expect(page).to have_content segment_recipient
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -162,16 +162,15 @@ describe "Admin newsletter emails", :admin do
|
|||||||
|
|
||||||
describe "Select list of users to send newsletter" do
|
describe "Select list of users to send newsletter" do
|
||||||
scenario "Custom user segments" do
|
scenario "Custom user segments" do
|
||||||
UserSegments.segments.each do |segment|
|
segment = UserSegments.segments.sample
|
||||||
segment_recipient = UserSegments.segment_name(segment)
|
segment_recipient = UserSegments.segment_name(segment)
|
||||||
|
|
||||||
visit new_admin_newsletter_path
|
visit new_admin_newsletter_path
|
||||||
|
|
||||||
fill_in_newsletter_form(segment_recipient: segment_recipient)
|
fill_in_newsletter_form(segment_recipient: segment_recipient)
|
||||||
click_button "Create Newsletter"
|
click_button "Create Newsletter"
|
||||||
|
|
||||||
expect(page).to have_content segment_recipient
|
expect(page).to have_content segment_recipient
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario "Geozone segments" do
|
scenario "Geozone segments" do
|
||||||
|
|||||||
Reference in New Issue
Block a user