I'm using email_spec gem to test a simple email, but for some reason the body content appears to be empty:
1) ContactMailer welcome email to new user renders the body
Failure/Error: mail.should have_body_text("Hi")
expected the body to contain "Hi" but was ""
# ./spec/mailers/contact_mailer_spec.rb:17:in `block (3 levels) in <top (required)>'
Every other example passes. The template file is called welcome_email.text.erb
. Not sure why body is not matched, but the email does have a body when it gets sent.
Edit: the Rspec code is:
let(:mail) { ContactMailer.welcome_email(email) }
it "renders the body" do
mail.should have_body_text("Hi")
end