aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorJon Leighton <j@jonathanleighton.com>2011-03-10 19:35:20 +0000
committerJon Leighton <j@jonathanleighton.com>2011-03-10 19:35:20 +0000
commit582edaa1ffd6d875e18c50e36e144544209fd158 (patch)
treece4fb934973e1385ec64b78df6984e4a6267fc11 /actionpack/test
parent2d3d9e3531d0d49a94ded10b993640053bd76c03 (diff)
parent51a269b2282ec09cf58614e738a2d0e40d2909d3 (diff)
downloadrails-582edaa1ffd6d875e18c50e36e144544209fd158.tar.gz
rails-582edaa1ffd6d875e18c50e36e144544209fd158.tar.bz2
rails-582edaa1ffd6d875e18c50e36e144544209fd158.zip
Merge branch 'master' into nested_has_many_through
Diffstat (limited to 'actionpack/test')
-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 1c28da33bd..3f3d6dcc2f 100644
--- a/actionpack/test/controller/url_for_test.rb
+++ b/actionpack/test/controller/url_for_test.rb
@@ -311,6 +311,14 @@ module AbstractController
assert_equal("/c/a", W.new.url_for(HashWithIndifferentAccess.new('controller' => 'c', 'action' => 'a', 'only_path' => true)))
end
+ def test_url_params_with_nil_to_param_are_not_in_url
+ assert_equal("/c/a", W.new.url_for(:only_path => true, :controller => 'c', :action => 'a', :id => Struct.new(:to_param).new(nil)))
+ end
+
+ def test_false_url_params_are_included_in_query
+ assert_equal("/c/a?show=false", W.new.url_for(:only_path => true, :controller => 'c', :action => 'a', :show => false))
+ end
+
private
def extract_params(url)
url.split('?', 2).last.split('&').sort