diff --git a/spec/services/placements/partnerships/notify/create_spec.rb b/spec/services/placements/partnerships/notify/create_spec.rb index 289bedbe95..daf8002aad 100644 --- a/spec/services/placements/partnerships/notify/create_spec.rb +++ b/spec/services/placements/partnerships/notify/create_spec.rb @@ -68,18 +68,14 @@ end it "does not send a notification email to users not belonging to the placements service" do - expect { partnership_notify_creation }.not_to have_enqueued_mail( - Placements::SchoolUserMailer, - :partnership_created_notification, - ).with( - user_3, provider, school - ) - expect { partnership_notify_creation }.not_to have_enqueued_mail( - Placements::ProviderUserMailer, - :partnership_created_notification, - ).with( - user_3, provider, school - ) + %i[SchoolUserMailer ProviderUserMailer].each do |mailer_class| + expect { partnership_notify_creation }.not_to have_enqueued_mail( + "Placements::#{mailer_class}".constantize, + :partnership_created_notification, + ).with( + user_3, provider, school + ) + end end end end