aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2018-07-18 16:15:16 -0400
committerGitHub <noreply@github.com>2018-07-18 16:15:16 -0400
commit5df23a04a31e95beb9a5728851345a68b3bca2ac (patch)
treeba4c9c4b366fa6a66a04c7fa453fad86036686fa /actionview/test
parent3c8c410012e34709f3fdfe5b6a571353b20d0c56 (diff)
parent113d8a2ba39da13840845bac3aa4f274a1dae19b (diff)
downloadrails-5df23a04a31e95beb9a5728851345a68b3bca2ac.tar.gz
rails-5df23a04a31e95beb9a5728851345a68b3bca2ac.tar.bz2
rails-5df23a04a31e95beb9a5728851345a68b3bca2ac.zip
Merge pull request #31320 from gtqnchev/to_form_params-fix
Fix issue with `button_to`'s `to_form_params`
Diffstat (limited to 'actionview/test')
-rw-r--r--actionview/test/template/url_helper_test.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/actionview/test/template/url_helper_test.rb b/actionview/test/template/url_helper_test.rb
index 08cb5dfea7..9d91dbb72b 100644
--- a/actionview/test/template/url_helper_test.rb
+++ b/actionview/test/template/url_helper_test.rb
@@ -77,11 +77,18 @@ class UrlHelperTest < ActiveSupport::TestCase
def test_to_form_params_with_hash
assert_equal(
- [{ name: :name, value: "David" }, { name: :nationality, value: "Danish" }],
+ [{ name: "name", value: "David" }, { name: "nationality", value: "Danish" }],
to_form_params(name: "David", nationality: "Danish")
)
end
+ def test_to_form_params_with_hash_having_symbol_and_string_keys
+ assert_equal(
+ [{ name: "name", value: "David" }, { name: "nationality", value: "Danish" }],
+ to_form_params("name" => "David", :nationality => "Danish")
+ )
+ end
+
def test_to_form_params_with_nested_hash
assert_equal(
[{ name: "country[name]", value: "Denmark" }],