有没有更简洁的方法来编写这个 rspec 代码?
mailer = double
AdminMailer.should_receive(:request_failed).with(@request).and_return(mailer)
mailer.should_receive(:deliver)
我正在设想这样的事情:
AdminMailer
.should_receive(:request_failed)
.with(@request)
.should_receive(:deliver)