From 757379128442d07ebebd7a3d22853d016cfb95b4 Mon Sep 17 00:00:00 2001 From: Michael Koziarski Date: Sat, 22 Sep 2007 19:20:06 +0000 Subject: Disable the routing optimisation code when dealing with foo_url helpers. Add test to actionmailer to expose the problem they introduced. References #9450 [Koz] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7572 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionmailer/test/fixtures/test_mailer/signed_up_with_url.erb | 2 +- actionmailer/test/url_test.rb | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'actionmailer') diff --git a/actionmailer/test/fixtures/test_mailer/signed_up_with_url.erb b/actionmailer/test/fixtures/test_mailer/signed_up_with_url.erb index e8fb65d4d2..08f05b5ef0 100644 --- a/actionmailer/test/fixtures/test_mailer/signed_up_with_url.erb +++ b/actionmailer/test/fixtures/test_mailer/signed_up_with_url.erb @@ -1,3 +1,3 @@ Hello there, -Mr. <%= @recipient %>. Please see our greeting at <%= @welcome_url %> \ No newline at end of file +Mr. <%= @recipient %>. Please see our greeting at <%= @welcome_url %> <%= welcome_url %> \ No newline at end of file diff --git a/actionmailer/test/url_test.rb b/actionmailer/test/url_test.rb index ded343cfc5..2c393651fd 100644 --- a/actionmailer/test/url_test.rb +++ b/actionmailer/test/url_test.rb @@ -1,6 +1,9 @@ require "#{File.dirname(__FILE__)}/abstract_unit" class TestMailer < ActionMailer::Base + + default_url_options[:host] = 'www.basecamphq.com' + def signed_up_with_url(recipient) @recipients = recipient @subject = "[Signed up] Welcome #{recipient}" @@ -47,12 +50,13 @@ class ActionMailerUrlTest < Test::Unit::TestCase def test_signed_up_with_url 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" + expected.body = "Hello there, \n\nMr. #{@recipient}. Please see our greeting at http://example.com/welcome/greeting http://www.basecamphq.com/welcome" expected.from = "system@loudthinking.com" expected.date = Time.local(2004, 12, 12) -- cgit v1.2.3