Permalink
Browse files

With ActionMailer 3, @email.body is no longer a string but is an obje…

…ct, so we need to add #to_s calls in order to match the body to a regex.
  • Loading branch information...
1 parent f51b56f commit 955fb45d1025b895bffa14dcc4f0cc305b15117b @myronmarston myronmarston committed Jan 27, 2010
Showing with 4 additions and 4 deletions.
  1. +4 −4 spec/spec/mailer_spec.rb
@@ -25,7 +25,7 @@ def deliver_message(message_name, *args)
end
it 'does not add a post script to the body' do
- @email.body.should_not =~ TEXT_POSTSCRIPT_PHRASE
+ @email.body.to_s.should_not =~ TEXT_POSTSCRIPT_PHRASE
end
end
@@ -67,7 +67,7 @@ def deliver_email_with_mix_of_internal_and_external_addresses(message_name)
end
it 'adds a plain text post script to the body' do
- @email.body.should =~ TEXT_POSTSCRIPT_PHRASE
+ @email.body.to_s.should =~ TEXT_POSTSCRIPT_PHRASE
end
end
@@ -77,7 +77,7 @@ def deliver_email_with_mix_of_internal_and_external_addresses(message_name)
end
it 'adds an html post script to the body' do
- @email.body.should =~ HTML_POSTSCRIPT_PHRASE
+ @email.body.to_s.should =~ HTML_POSTSCRIPT_PHRASE
end
end
@@ -87,7 +87,7 @@ def deliver_email_with_mix_of_internal_and_external_addresses(message_name)
end
def part(type)
- @email.parts.detect { |p| p.content_type == type }.body
+ @email.parts.detect { |p| p.content_type == type }.body.to_s
end
it 'adds a text post script to the body of the text part' do

0 comments on commit 955fb45

Please sign in to comment.