rails/rails — pull request #14395 by arthurnn (2014-03-15 23:04:55+00:00)
Title: Fix MailerPreview broken tests

### Problem
`actionmailer base_test` fails randomly on travis ATM.

### Why/Solution
`BaseMailerPreview.welcome` is an instance method, so we need to stub the
method on a instance level and not on Class. The stub is important, to make
sure the Message object is the same in the other expectations.
This was working randomly because Mocha uses == to compare two objects
on the `with()` expectation and even if the Mail::Message objects were
not the same object, they are equal, but thats not the case in 100% of
the runs. So we need to make sure we use `.any_instance` method and have
the right message object.

review @rafaelfranca @jeremy @pixeltrix

:heart: :heart: :heart: :heart: thanks to @robin850 for given me ssh access to his machine that we were able to simulate the issue.