Closed zeeshangulzar closed 6 years ago
@zeeshangulzar There is nothing special about testing here. It's a regular ActionMailer class. Just set delivery method to :test
and it should do the job. Refer to https://github.com/PavelTyk/sendgrid-rails/blob/master/spec/spec_helper.rb for inspiration. Also you may use ActionMailer::Base.deliveries
to refer to recent delivered messaged in your tests.
Got it. Thanks Pavel. I have resolve the issue in very similar way as you mentioned. Thanks for help and quick response.
Does Sendgrid-rails gem provide any service for offline mailer for testing. i.e https://github.com/tongboy/mailjet_mailer#offline-testing
I need to add it in my rspec to make my test cases work.