Hi all,
 I am writing an action mailer test and am trying to snatch contents
of the @body hash provided for the template for testing. Specifically,
my plan is to do something like:

FooMailer.class_eval do
  attr_accessor :original_body
  def render_message method, body
    self.original_body = body
    super method, body
  end
end

and then test that a FooMailer instance has its original_body setup
correctly (together with to, from and other headers).

However, I noticed that ActionMailer::Base goes out of its way to
prevent instantiating mailer objects. Why does it do that?

Thanks,
 Dmitry

PS I realize that usual approach is just use pattern matching for the
resulting TMail body. However such method seems to strongly couple the
test to the email body template (e.g. I may setup the body[:profile]
but the email resulting body may only contain the @profile.name, so
the test has to know that the template renders just the name and
change if the template changes)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to