Replace .all.each with .find_each on admin specs
This commit is contained in:
@@ -199,7 +199,7 @@ feature "Admin Notifications" do
|
|||||||
|
|
||||||
expect(page).to have_content "Notification sent successfully"
|
expect(page).to have_content "Notification sent successfully"
|
||||||
|
|
||||||
User.all.each do |user|
|
User.find_each do |user|
|
||||||
expect(user.notifications.count).to eq(1)
|
expect(user.notifications.count).to eq(1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ feature "Admin newsletter emails" do
|
|||||||
|
|
||||||
expect(page).to have_css(".newsletter", count: 3)
|
expect(page).to have_css(".newsletter", count: 3)
|
||||||
|
|
||||||
Newsletter.all.each do |newsletter|
|
Newsletter.find_each do |newsletter|
|
||||||
segment_recipient = I18n.t("admin.segment_recipient.#{newsletter.segment_recipient}")
|
segment_recipient = I18n.t("admin.segment_recipient.#{newsletter.segment_recipient}")
|
||||||
within("#newsletter_#{newsletter.id}") do
|
within("#newsletter_#{newsletter.id}") do
|
||||||
expect(page).to have_content newsletter.subject
|
expect(page).to have_content newsletter.subject
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ feature 'Signature sheets' do
|
|||||||
|
|
||||||
expect(page).to have_css(".signature_sheet", count: 3)
|
expect(page).to have_css(".signature_sheet", count: 3)
|
||||||
|
|
||||||
SignatureSheet.all.each do |signature_sheet|
|
SignatureSheet.find_each do |signature_sheet|
|
||||||
expect(page).to have_content signature_sheet.name
|
expect(page).to have_content signature_sheet.name
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ feature 'Stats' do
|
|||||||
|
|
||||||
expect(page).to have_css(".proposal_notification", count: 3)
|
expect(page).to have_css(".proposal_notification", count: 3)
|
||||||
|
|
||||||
ProposalNotification.all.each do |proposal_notification|
|
ProposalNotification.find_each do |proposal_notification|
|
||||||
expect(page).to have_content proposal_notification.title
|
expect(page).to have_content proposal_notification.title
|
||||||
expect(page).to have_content proposal_notification.body
|
expect(page).to have_content proposal_notification.body
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user