X-Git-Url: https://nos-oignons.net/gitweb/gestion-adh.git/blobdiff_plain/9d982cb5d7f9abe598c8df3eefabe10501056110..e3849b258d72a17748bd07c931980d382ac88082:/features/step_definitions/emails.rb diff --git a/features/step_definitions/emails.rb b/features/step_definitions/emails.rb index 9ed3f98..e2e562e 100644 --- a/features/step_definitions/emails.rb +++ b/features/step_definitions/emails.rb @@ -27,3 +27,22 @@ end Then /^(\d+) emails? (?:doit|doivent) avoir été envoyés?$/ do |count| Mail::TestMailer.deliveries.should have(count).email end + +Then /^des emails doivent avoir été envoyés à Jane, Fatima, Fred et Moly$/ do + recipients = Mail::TestMailer.deliveries.collect(&:to) + recipients.should include(['jane@example.org']) + recipients.should include(['fatima@example.org']) + recipients.should include(['fred@example.org']) + recipients.should include(['moly@example.org']) +end + +Then /^un email doit avoir été envoyé au comité de déontologie$/ do + expect(Mail::TestMailer.deliveries).to have(1).email + expect(Mail::TestMailer.deliveries.first.to).to include('deontologie@nos-oignons.net') +end + +Then /^il doit contenir les adresses emails de Jane et Fred$/ do + expect(Mail::TestMailer.deliveries.first.body).to include('jane@example.org') + expect(Mail::TestMailer.deliveries.first.body).to include('fred@example.org') +end +