vendor/rails/actionmailer/test/mail_helper_test.rb in radiant-0.6.4 vs vendor/rails/actionmailer/test/mail_helper_test.rb in radiant-0.6.5

- old
+ new

@@ -6,19 +6,19 @@ end end class HelperMailer < ActionMailer::Base helper MailerHelper - helper :test + helper :example def use_helper(recipient) recipients recipient subject "using helpers" from "tester@example.com" end - def use_test_helper(recipient) + def use_example_helper(recipient) recipients recipient subject "using helpers" from "tester@example.com" self.body = { :text => "emphasize me!" } end @@ -58,23 +58,27 @@ mail.set_content_type "text", "plain", { "charset" => charset } if charset mail end def setup - ActionMailer::Base.delivery_method = :test + set_delivery_method :test ActionMailer::Base.perform_deliveries = true ActionMailer::Base.deliveries = [] @recipient = 'test@localhost' end - + + def teardown + restore_delivery_method + end + def test_use_helper mail = HelperMailer.create_use_helper(@recipient) assert_match %r{Mr. Joe Person}, mail.encoded end - def test_use_test_helper - mail = HelperMailer.create_use_test_helper(@recipient) + def test_use_example_helper + mail = HelperMailer.create_use_example_helper(@recipient) assert_match %r{<em><strong><small>emphasize me!}, mail.encoded end def test_use_helper_method mail = HelperMailer.create_use_helper_method(@recipient)