aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
authorDerek Watson <watson@dcw.ca>2013-04-11 22:12:19 -0400
committerAndrew White <andyw@pixeltrix.co.uk>2013-04-18 17:12:40 +0100
commit6183e1a460ccab6df1d07c3e99e98b61b2cc450b (patch)
treed585a05a0202f30b2e51d27d11e59fae20b5c320 /actionpack/test/controller
parent296830ed0f8732c6779dcdfed0f0e3d59947e47c (diff)
downloadrails-6183e1a460ccab6df1d07c3e99e98b61b2cc450b.tar.gz
rails-6183e1a460ccab6df1d07c3e99e98b61b2cc450b.tar.bz2
rails-6183e1a460ccab6df1d07c3e99e98b61b2cc450b.zip
Passing subdomain: '' to url_for removes the subdomain (instead of adding a leading .)
Adding a boolean route constraint checks for presence/absence of request property
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/url_for_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/actionpack/test/controller/url_for_test.rb b/actionpack/test/controller/url_for_test.rb
index ba24e7fac5..088ad73f2f 100644
--- a/actionpack/test/controller/url_for_test.rb
+++ b/actionpack/test/controller/url_for_test.rb
@@ -89,6 +89,13 @@ module AbstractController
)
end
+ def test_subdomain_may_be_removed_with_blank_string
+ W.default_url_options[:host] = 'api.basecamphq.com'
+ assert_equal('http://basecamphq.com/c/a/i',
+ W.new.url_for(:subdomain => '', :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',