aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test
diff options
context:
space:
mode:
authorTyler Hunt <tyler@tylerhunt.com>2017-01-02 23:46:24 -0500
committerTyler Hunt <tyler@tylerhunt.com>2017-01-03 09:27:57 -0500
commit3d2645ab138c9158ca4224458de74c723d4441cc (patch)
treed602b1b10f22e494f3c31bbc34e2c9231983381d /actionview/test
parent33e60514aed85b3076f2636d5f1ccfb513aace1c (diff)
downloadrails-3d2645ab138c9158ca4224458de74c723d4441cc.tar.gz
rails-3d2645ab138c9158ca4224458de74c723d4441cc.tar.bz2
rails-3d2645ab138c9158ca4224458de74c723d4441cc.zip
Prevent duplicate data-disable-with attributes
When using the hash form of the data option, prevent duplicate data-disable-with attributes from appearing in the submit tag due to both string and symbol forms of the hash key being present.
Diffstat (limited to 'actionview/test')
-rw-r--r--actionview/test/template/form_tag_helper_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/actionview/test/template/form_tag_helper_test.rb b/actionview/test/template/form_tag_helper_test.rb
index 1248a0bb09..084c540139 100644
--- a/actionview/test/template/form_tag_helper_test.rb
+++ b/actionview/test/template/form_tag_helper_test.rb
@@ -510,6 +510,13 @@ class FormTagHelperTest < ActionView::TestCase
)
end
+ def test_submit_tag_doesnt_have_data_disable_with_twice_with_hash
+ assert_equal(
+ %(<input type="submit" name="commit" value="Save" data-disable-with="Processing..." />),
+ submit_tag("Save", data: { disable_with: "Processing..." })
+ )
+ end
+
def test_submit_tag_with_symbol_value
assert_dom_equal(
%(<input data-disable-with="Save" name='commit' type="submit" value="Save" />),