Home > Programming stuff, Ruby || Rails > ERb’in “ActionMailer fixtures” Up

ERb’in “ActionMailer fixtures” Up

June 16th, 2009

I don’t know if my slightly outdated Rails 2.2.2 is the problem. But unlike in the fixtures for normal unit tests, I can’t use ERb for my ActionMailers templates.

Add this method to your ActionMailer::TestCase to let ERb pre-process your fixtures:

  def read_fixture(action)
    a = super
    template = ERB.new(a.join)
Comments are closed.