This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Mailer.should deliver(:job_application).with(@job.id, @user.id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
message = double | |
message.should_receive(:deliver) | |
Mailer.should_receive(:job_application).with(@job.id, @user.id).and_return(message) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RSpec::Matchers.define :deliver do |message| | |
chain :with do |*args| | |
@with = args | |
end | |
match do |mailer| | |
mail = double | |
mail.should_receive(:deliver) | |
mailer.should_receive(message).with(*@with).and_return(mail) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment