Forum: Ruby on Rails Rails 4.2 Mailer Problem

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
B4b3b492a8242c03ecfe11683c39e7eb?d=identicon&s=25 Philipp Näö (Guest)
on 2014-12-28 19:36
(Received via mailing list)
Since we updated our application to Rails 4.2, our mailer tests seems to
fail (or not) randomly.

Simplified mailer code:

class ReservationMailer < ActionMailer::Base
  default from: 'no-reply@1.de',
          bcc: 'kopie@1.de'

  def reservation_received(reservation)
    @reservation = reservation
    @product = reservation.product

    mail to: @reservation.email,
         from: 'no-reply@unishop-bamberg.de',
         subject: "Bestätigung Eingang Vormerkung für Produkt
#{@product.name}"
  end
end

Simplified test code:

    reservation = Reservation.new(email: 'max@mustermann.com', product:
product)

    email =
ReservationMailer.reservation_received(reservation).deliver_now

    assert_equal 1, ActionMailer::Base.deliveries.size

There are some more mailers very similar to this mailer and the tests
seem
to fail randomly.

That means, sometimes just one of these tests fail, sometimes two and
somewhen nothing fails.

I couldn't figure out any problem, but maybe you can help me out :)
E65ef65e6d474741c2ec70c7fa7430b1?d=identicon&s=25 Alexander Ross (alexander_r)
on 2015-02-23 18:24
Having this problem to. Have you found any solutions for it yet?
This topic is locked and can not be replied to.