aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template
diff options
context:
space:
mode:
authorAkshay Vishnoi <akshay.vishnoi@vinsol.com>2015-09-18 12:44:09 +0530
committerAkshay Vishnoi <akshay.vishnoi@vinsol.com>2015-09-18 12:44:09 +0530
commit9331f00229205c3a018af92cb50907d4fc87ecdc (patch)
tree1c456ad15779e668dfcffc57b5ab0e112e70c667 /actionview/test/template
parent95593f0419b1ab2e2ace5ed971204d74c10ac2fb (diff)
downloadrails-9331f00229205c3a018af92cb50907d4fc87ecdc.tar.gz
rails-9331f00229205c3a018af92cb50907d4fc87ecdc.tar.bz2
rails-9331f00229205c3a018af92cb50907d4fc87ecdc.zip
Fix - Prevent adding of `data-disable-with` option twice in html.
Earlier when `data-disable-with` option is added direclty as in options then ```ruby submit_tag("Save", { "data-disable-with" => "Processing..." }) # => <input type="submit" name="commit" value="Save" data-disable-with="Processing..." data-disable-with="Processing..." /> ``` Now when `data-disable-with` option is added direclty as in options then ```ruby submit_tag("Save", { "data-disable-with" => "Processing..." }) # => <input type="submit" name="commit" value="Save" data-disable-with="Processing..." /> ```
Diffstat (limited to 'actionview/test/template')
-rw-r--r--actionview/test/template/form_tag_helper_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/actionview/test/template/form_tag_helper_test.rb b/actionview/test/template/form_tag_helper_test.rb
index a9d9562580..7e1324c011 100644
--- a/actionview/test/template/form_tag_helper_test.rb
+++ b/actionview/test/template/form_tag_helper_test.rb
@@ -485,6 +485,14 @@ class FormTagHelperTest < ActionView::TestCase
)
end
+ def test_submit_tag_doesnt_have_data_disable_with_twice
+ assert_equal(
+ %(<input type="submit" name="commit" value="Save" data-confirm="Are you sure?" data-disable-with="Processing..." />),
+ submit_tag("Save", { "data-disable-with" => "Processing...", "data-confirm" => "Are you sure?" })
+ )
+ end
+
+
def test_button_tag
assert_dom_equal(
%(<button name="button" type="submit">Button</button>),