[rspec-users] RSpec Email-Spec Problem

Rails Learner lists at ruby-forum.com
Wed Jul 14 10:40:20 EDT 2010

I have figure this out.
I wanted to share this in case someone is having the same problem.

I have taken a different route to test email body:
Here is how my example looks now:

  it "should contain child's first name and last name in email body" do
    for part in @email.parts
      if part["Content-Type"].to_s =~ /^text\/html\W/
        root = part.body
        assert_match '<p>New Enrollment Form for 
FakeFirstName&nbsp;FakeLastName</p>', root.to_s

Hope this will help someone.


Posted via http://www.ruby-forum.com/.

More information about the rspec-users mailing list