diff options
author | J Smith <dark.panda@gmail.com> | 2010-04-21 21:37:51 -0400 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-04-22 16:47:36 +0200 |
commit | 275e839b8dfa3cf2bdedf1b31302dec20ac96a46 (patch) | |
tree | 5febc560a25047cb909302c06d1dadf92bf20b00 /actionpack/test/controller | |
parent | 9476daa829f7dd0681121e042dd1356af0d50ca0 (diff) | |
download | rails-275e839b8dfa3cf2bdedf1b31302dec20ac96a46.tar.gz rails-275e839b8dfa3cf2bdedf1b31302dec20ac96a46.tar.bz2 rails-275e839b8dfa3cf2bdedf1b31302dec20ac96a46.zip |
Ensure that url_for uses symbolized keys in the controller. [#4391]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/url_for_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/test/controller/url_for_test.rb b/actionpack/test/controller/url_for_test.rb index fc7773dffe..501f928e05 100644 --- a/actionpack/test/controller/url_for_test.rb +++ b/actionpack/test/controller/url_for_test.rb @@ -257,6 +257,16 @@ module AbstractController assert_equal second_class.default_url_options[:host], second_host end + def test_with_stringified_keys + assert_equal("/c/a", W.new.url_for('controller' => 'c', 'action' => 'a', 'only_path' => true)) + assert_equal("/c", W.new.url_for('controller' => 'c', 'only_path' => true)) + end + + def test_with_hash_with_indifferent_access + assert_equal("/c/a", W.new.url_for(HashWithIndifferentAccess.new('controller' => 'c', 'action' => 'a', 'only_path' => true))) + assert_equal("/c", W.new.url_for(HashWithIndifferentAccess.new('controller' => 'c', 'only_path' => true))) + end + private def extract_params(url) url.split('?', 2).last.split('&').sort |