Extract method to get a user segment name
We're going to add geozones as user segments, so it's handy to have the method in the UserSegments class. We're also changing the `user_segment_emails` parameter name for consistency and simplicity.
This commit is contained in:
@@ -215,15 +215,15 @@ describe "Admin Notifications", :admin do
|
||||
end
|
||||
|
||||
scenario "Select list of users to send notification" do
|
||||
UserSegments.segments.each do |user_segment|
|
||||
segment_recipient = I18n.t("admin.segment_recipient.#{user_segment}")
|
||||
UserSegments.segments.each do |segment|
|
||||
segment_recipient = UserSegments.segment_name(segment)
|
||||
|
||||
visit new_admin_admin_notification_path
|
||||
|
||||
fill_in_admin_notification_form(segment_recipient: segment_recipient)
|
||||
click_button "Create notification"
|
||||
|
||||
expect(page).to have_content(I18n.t("admin.segment_recipient.#{user_segment}"))
|
||||
expect(page).to have_content segment_recipient
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user