Rails 4.2 Mailer Problem

36 views
Skip to first unread message

Philipp Näö

unread,
Dec 28, 2014, 2:35:06 PM12/28/14
to rubyonra...@googlegroups.com
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-r...@1.de',
          bcc: 'ko...@1.de'

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

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

Simplified test code:

    reservation = Reservation.new(email: 'm...@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 :)

Philipp Näö

unread,
Jan 5, 2015, 7:54:05 PM1/5/15
to rubyonra...@googlegroups.com
No one has an idea?
Reply all
Reply to author
Forward
0 new messages