diff options
author | Mikel Lindsaar <raasdnil@gmail.com> | 2009-12-17 11:24:02 +1100 |
---|---|---|
committer | Mikel Lindsaar <raasdnil@gmail.com> | 2009-12-17 11:24:02 +1100 |
commit | 186cd7bc530f705b889c27f3680ab48c7c10a6f3 (patch) | |
tree | 76955e442615d77ee05ef2a8260c5373e1cac680 /actionmailer/test/url_test.rb | |
parent | 5f2395041d1578433fa825ed5c6f26a201f2203d (diff) | |
parent | b9d4ceb43c9497fb1c47d8b1e1e6a24a9e157384 (diff) | |
download | rails-186cd7bc530f705b889c27f3680ab48c7c10a6f3.tar.gz rails-186cd7bc530f705b889c27f3680ab48c7c10a6f3.tar.bz2 rails-186cd7bc530f705b889c27f3680ab48c7c10a6f3.zip |
Merge branch 'rails'
Conflicts:
actionmailer/lib/action_mailer.rb
actionmailer/lib/action_mailer/delivery_method/smtp.rb
Diffstat (limited to 'actionmailer/test/url_test.rb')
-rw-r--r-- | actionmailer/test/url_test.rb | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/actionmailer/test/url_test.rb b/actionmailer/test/url_test.rb index 427833b36c..0e565b95e8 100644 --- a/actionmailer/test/url_test.rb +++ b/actionmailer/test/url_test.rb @@ -1,7 +1,9 @@ require 'abstract_unit' -class TestMailer < ActionMailer::Base +class WelcomeController < ActionController::Base +end +class TestMailer < ActionMailer::Base default_url_options[:host] = 'www.basecamphq.com' def signed_up_with_url(recipient) @@ -52,27 +54,25 @@ class ActionMailerUrlTest < Test::Unit::TestCase end def test_signed_up_with_url - ActionController::Routing.use_controllers! ['welcome'] do - ActionController::Routing::Routes.draw do |map| - map.connect ':controller/:action/:id' - map.welcome 'welcome', :controller=>"foo", :action=>"bar" - end - - expected = new_mail - expected.to = @recipient - expected.subject = "[Signed up] Welcome #{@recipient}" - expected.body = "Hello there, \n\nMr. #{@recipient}. Please see our greeting at http://example.com/welcome/greeting http://www.basecamphq.com/welcome\n\n<img alt=\"Somelogo\" src=\"/images/somelogo.png\" />" - expected.from = "system@loudthinking.com" - expected.date = Time.local(2004, 12, 12) - - created = nil - assert_nothing_raised { created = TestMailer.create_signed_up_with_url(@recipient) } - assert_not_nil created - assert_equal expected.encoded, created.encoded - - assert_nothing_raised { TestMailer.deliver_signed_up_with_url(@recipient) } - assert_not_nil ActionMailer::Base.deliveries.first - assert_equal expected.encoded, ActionMailer::Base.deliveries.first.encoded + ActionController::Routing::Routes.draw do |map| + map.connect ':controller/:action/:id' + map.welcome 'welcome', :controller=>"foo", :action=>"bar" end + + expected = new_mail + expected.to = @recipient + expected.subject = "[Signed up] Welcome #{@recipient}" + expected.body = "Hello there, \n\nMr. #{@recipient}. Please see our greeting at http://example.com/welcome/greeting http://www.basecamphq.com/welcome\n\n<img alt=\"Somelogo\" src=\"/images/somelogo.png\" />" + expected.from = "system@loudthinking.com" + expected.date = Time.local(2004, 12, 12) + + created = nil + assert_nothing_raised { created = TestMailer.create_signed_up_with_url(@recipient) } + assert_not_nil created + assert_equal expected.encoded, created.encoded + + assert_nothing_raised { TestMailer.deliver_signed_up_with_url(@recipient) } + assert_not_nil ActionMailer::Base.deliveries.first + assert_equal expected.encoded, ActionMailer::Base.deliveries.first.encoded end end |