aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/url_for_test.rb
diff options
context:
space:
mode:
authorManuel Menezes de Sequeira <MMSequeira@gmail.com>2011-10-05 22:14:49 +0100
committerManuel Menezes de Sequeira <MMSequeira@gmail.com>2011-10-05 22:14:49 +0100
commit07343d2974ab77bfd21c0f35930cd394ba5b164e (patch)
treec64f8b54507d41ccb2c59cb096ee8b1f2a31e2df /actionpack/test/controller/url_for_test.rb
parent8d775d5f1d58e5c0d881383e8c6e869d1d360c8c (diff)
parentd6c7185d77158caee933e84b247e37bb6a67bf58 (diff)
downloadrails-07343d2974ab77bfd21c0f35930cd394ba5b164e.tar.gz
rails-07343d2974ab77bfd21c0f35930cd394ba5b164e.tar.bz2
rails-07343d2974ab77bfd21c0f35930cd394ba5b164e.zip
Merge branch 'master' of github.com:lifo/docrails
Diffstat (limited to 'actionpack/test/controller/url_for_test.rb')
-rw-r--r--actionpack/test/controller/url_for_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/actionpack/test/controller/url_for_test.rb b/actionpack/test/controller/url_for_test.rb
index 484e996f31..11ced2df2a 100644
--- a/actionpack/test/controller/url_for_test.rb
+++ b/actionpack/test/controller/url_for_test.rb
@@ -67,6 +67,20 @@ module AbstractController
)
end
+ def test_subdomain_may_be_removed
+ add_host!
+ assert_equal('http://basecamphq.com/c/a/i',
+ W.new.url_for(:subdomain => false, :controller => 'c', :action => 'a', :id => 'i')
+ )
+ end
+
+ def test_multiple_subdomains_may_be_removed
+ W.default_url_options[:host] = 'mobile.www.api.basecamphq.com'
+ assert_equal('http://basecamphq.com/c/a/i',
+ W.new.url_for(:subdomain => false, :controller => 'c', :action => 'a', :id => 'i')
+ )
+ end
+
def test_domain_may_be_changed
add_host!
assert_equal('http://www.37signals.com/c/a/i',