# along with this program. If not, see <http://www.gnu.org/licenses/>.
Then /^aucun email ne doit avoir été envoyé$/ do
- Mail::TestMailer.deliveries.should be_empty
+ expect(Mail::TestMailer.deliveries.size).to eq(0)
end
Then /^un appel pour la cotisation doit avoir été envoyé$/ do
- Mail::TestMailer.deliveries.should have(1).email
+ expect(Mail::TestMailer.deliveries.size).to eq(1)
mail = Mail::TestMailer.deliveries.first
expect(mail.from).to eql([NosOignons::BOARD_EMAIL])
expect(mail.to).to eql([@last_member['email']])
end
Then /^(\d+) emails? (?:doit|doivent) avoir été envoyés?$/ do |count|
- Mail::TestMailer.deliveries.should have(count).email
+ expect(Mail::TestMailer.deliveries.size).to eq(count.to_i)
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'])
+ expect(recipients).to include(['jane@example.org'])
+ expect(recipients).to include(['fatima@example.org'])
+ expect(recipients).to include(['fred@example.org'])
+ expect(recipients).to 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.size).to eq(1)
expect(Mail::TestMailer.deliveries.first.to).to include('deontologie@nos-oignons.net')
end