aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
authorchoonkeat <choonkeat@gmail.com>2011-12-14 22:43:42 +0800
committerchoonkeat <choonkeat@gmail.com>2011-12-14 22:43:42 +0800
commit5f67cfeda116f2b932ef72781420aa37e62437ca (patch)
treeba15dc4877e1d9f3b734c1fd2fd5b289593e7293 /actionpack/test/controller
parenta5589db063e0f527357f6be338adecf4716e6b47 (diff)
downloadrails-5f67cfeda116f2b932ef72781420aa37e62437ca.tar.gz
rails-5f67cfeda116f2b932ef72781420aa37e62437ca.tar.bz2
rails-5f67cfeda116f2b932ef72781420aa37e62437ca.zip
Fix url_for options[:subdomain] to allow objects as values
* e.g. blog_url(subdomain: current_user) instead of blog_url(subdomain: current_user.to_param)
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/url_for_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/actionpack/test/controller/url_for_test.rb b/actionpack/test/controller/url_for_test.rb
index dc07e07cb9..288efbf7c3 100644
--- a/actionpack/test/controller/url_for_test.rb
+++ b/actionpack/test/controller/url_for_test.rb
@@ -71,6 +71,14 @@ module AbstractController
)
end
+ def test_subdomain_may_be_object
+ model = mock(:to_param => 'api')
+ add_host!
+ assert_equal('http://api.basecamphq.com/c/a/i',
+ W.new.url_for(:subdomain => model, :controller => 'c', :action => 'a', :id => 'i')
+ )
+ end
+
def test_subdomain_may_be_removed
add_host!
assert_equal('http://basecamphq.com/c/a/i',