aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/form_tag_helper_test.rb
diff options
context:
space:
mode:
authorCarlos Galdino + Rafael Mendonça França <rafael.franca+carlos.galdino@plataformatec.com.br>2012-05-14 16:22:53 -0300
committerCarlos Galdino + Rafael Mendonça França <rafael.franca+carlos.galdino@plataformatec.com.br>2012-05-14 16:43:54 -0300
commit21141e777bdce8534e3755c8de7268324b3d8714 (patch)
tree1ad186ffbba5adcd0dd5f3ba76150db3c431cf5a /actionpack/test/template/form_tag_helper_test.rb
parent2506d4ad9e79532a0000ebd73baf0478db30f5c9 (diff)
downloadrails-21141e777bdce8534e3755c8de7268324b3d8714.tar.gz
rails-21141e777bdce8534e3755c8de7268324b3d8714.tar.bz2
rails-21141e777bdce8534e3755c8de7268324b3d8714.zip
Deprecate `:disable_with` in favor of `'data-disable-with'` option for `button_to` and `submit_tag` helpers.
Diffstat (limited to 'actionpack/test/template/form_tag_helper_test.rb')
-rw-r--r--actionpack/test/template/form_tag_helper_test.rb30
1 files changed, 18 insertions, 12 deletions
diff --git a/actionpack/test/template/form_tag_helper_test.rb b/actionpack/test/template/form_tag_helper_test.rb
index dcc6dd0411..1bfe2856dc 100644
--- a/actionpack/test/template/form_tag_helper_test.rb
+++ b/actionpack/test/template/form_tag_helper_test.rb
@@ -367,17 +367,21 @@ class FormTagHelperTest < ActionView::TestCase
end
def test_submit_tag
- assert_dom_equal(
- %(<input name='commit' data-disable-with="Saving..." onclick="alert('hello!')" type="submit" value="Save" />),
- submit_tag("Save", :disable_with => "Saving...", :onclick => "alert('hello!')")
- )
+ assert_deprecated ":disable_with option is deprecated and will be removed from Rails 4.0. Use :data-disable-with instead" do
+ assert_dom_equal(
+ %(<input name='commit' data-disable-with="Saving..." onclick="alert('hello!')" type="submit" value="Save" />),
+ submit_tag("Save", :disable_with => "Saving...", :onclick => "alert('hello!')")
+ )
+ end
end
def test_submit_tag_with_no_onclick_options
- assert_dom_equal(
- %(<input name='commit' data-disable-with="Saving..." type="submit" value="Save" />),
- submit_tag("Save", :disable_with => "Saving...")
- )
+ assert_deprecated ":disable_with option is deprecated and will be removed from Rails 4.0. Use :data-disable-with instead" do
+ assert_dom_equal(
+ %(<input name='commit' data-disable-with="Saving..." type="submit" value="Save" />),
+ submit_tag("Save", :disable_with => "Saving...")
+ )
+ end
end
def test_submit_tag_with_confirmation
@@ -388,10 +392,12 @@ class FormTagHelperTest < ActionView::TestCase
end
def test_submit_tag_with_confirmation_and_with_disable_with
- assert_dom_equal(
- %(<input name="commit" data-disable-with="Saving..." data-confirm="Are you sure?" type="submit" value="Save" />),
- submit_tag("Save", :disable_with => "Saving...", :confirm => "Are you sure?")
- )
+ assert_deprecated ":disable_with option is deprecated and will be removed from Rails 4.0. Use :data-disable-with instead" do
+ assert_dom_equal(
+ %(<input name="commit" data-disable-with="Saving..." data-confirm="Are you sure?" type="submit" value="Save" />),
+ submit_tag("Save", :disable_with => "Saving...", :confirm => "Are you sure?")
+ )
+ end
end
def test_button_tag