diff options
author | Arthur Nogueira Neves <github@arthurnn.com> | 2015-11-26 16:10:46 -0500 |
---|---|---|
committer | Arthur Nogueira Neves <github@arthurnn.com> | 2015-11-26 16:10:46 -0500 |
commit | 9afb0b9c432f6987a59b44c2fff15785b5fd5784 (patch) | |
tree | 91c94f15998f1038ad8637eab23b5dd434c5a44a /actionview/test/template | |
parent | 52141d365805f6433c9adf272aa6c19e3049147e (diff) | |
parent | e6e056c2c141ec94eb8e79a30ee766f77fdaf30d (diff) | |
download | rails-9afb0b9c432f6987a59b44c2fff15785b5fd5784.tar.gz rails-9afb0b9c432f6987a59b44c2fff15785b5fd5784.tar.bz2 rails-9afb0b9c432f6987a59b44c2fff15785b5fd5784.zip |
Merge pull request #21241 from pdg137/master
In url_for, never append ? when the query string is empty anyway.
Diffstat (limited to 'actionview/test/template')
-rw-r--r-- | actionview/test/template/url_helper_test.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/actionview/test/template/url_helper_test.rb b/actionview/test/template/url_helper_test.rb index 48d0a9a47a..62fa75bc63 100644 --- a/actionview/test/template/url_helper_test.rb +++ b/actionview/test/template/url_helper_test.rb @@ -38,6 +38,10 @@ class UrlHelperTest < ActiveSupport::TestCase assert_equal "/?a=b&c=d", url_for(hash_for(a: :b, c: :d)) end + def test_url_for_does_not_include_empty_hashes + assert_equal "/", url_for(hash_for(a: {})) + end + def test_url_for_with_back referer = 'http://www.example.com/referer' @controller = Struct.new(:request).new(Struct.new(:env).new("HTTP_REFERER" => referer)) |