Showing posts with label specs. Show all posts
Showing posts with label specs. Show all posts

20140330

mail_view for human — and also for automatic — testing

I've come to use a nice gem called mail_view for visual testing of email templates in Rails.
I think it is totally legit and desirable to re-use that code in the views testing suite, so here we go:
(provided that your MailView's subclass is MailPreview, put this in ./spec/views/mail_spec.rb)

This just checks for the lack of exceptions and any content, but it's a starting point.

p.s. A nice complementary pull request of mine is here.

20140116

I18n testing outfit for Rails 3.2 (also Rails 4.0-stable)

Now put this in config/initializers/i18n_test.rb and spec it!

N.B. Curiously enough, a similar technique is needed for 4.0 as well.

P.S. Tested and working with Rails 4.0-stable, yay!