0

My testing env uses spork & cucumber - Im able to run my tests fine and decided to include email_spec. However the email tests are failing

  1. My emails are sent out using delayed_job
  2. email_spec is running the delayed job before checking the emails
  3. However the emails (which use haml) are not getting sent out because the delayed_job is failing with

    Missing template user_response_mailer/send_contact_info with {:handlers=>[:erb, :rjs, :builder, :rhtml, :rxml], :formats=>[:html], :locale=>[:en]
    
  4. Note that the handlers in the error don't show :haml in its list of handler. Ive got the haml and haml-rails gem in my gemfile and my app send out mail properly in non-test env (no such errors as above in dev/prod)

The main question is

    Why is haml not getting loaded automatically when my email templates are being rendered via delayed_job running under spork ?
Mohith Thimmaiah
  • 857
  • 1
  • 9
  • 21

1 Answers1

0

This must be a spork issue, nothing else. Have you restarted your spork server after installing HAML?

I ask because: I use email_spec with rspec/cucumber and now spork, and everything in my app is HAML. Emails are delivered by resque-mailer, not delayed_job. The issue I had was that when running with spork, changes to the HAML templates are not picked up (ie the HAML plugin uses the pre-compiled, cached copies of the templates).

Looking at your error, HAML is simply not loaded. If it was, the :handlers array would have had :haml in the list.

In my case, disabling view caching should solve the issue, I'm still poking around on that one

Kenneth Kalmer
  • 341
  • 2
  • 5