paveltyk / sendgrid-rails

SendGrid extensions to Rails 3 ActionMailer::Base
http://paveltyk.github.com/sendgrid-rails/
73 stars 23 forks source link

Offline Mailer #32

Closed zeeshangulzar closed 6 years ago

zeeshangulzar commented 6 years ago

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.

paveltyk commented 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.

zeeshangulzar commented 6 years ago

Got it. Thanks Pavel. I have resolve the issue in very similar way as you mentioned. Thanks for help and quick response.