diff options
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/template/form_tag_helper_test.rb | 15 | ||||
-rw-r--r-- | actionpack/test/template/url_helper_test.rb | 6 |
2 files changed, 15 insertions, 6 deletions
diff --git a/actionpack/test/template/form_tag_helper_test.rb b/actionpack/test/template/form_tag_helper_test.rb index 1bfe2856dc..d9f91e952b 100644 --- a/actionpack/test/template/form_tag_helper_test.rb +++ b/actionpack/test/template/form_tag_helper_test.rb @@ -367,7 +367,7 @@ class FormTagHelperTest < ActionView::TestCase end def test_submit_tag - assert_deprecated ":disable_with option is deprecated and will be removed from Rails 4.0. Use :data-disable-with instead" do + 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!')") @@ -376,7 +376,7 @@ class FormTagHelperTest < ActionView::TestCase end def test_submit_tag_with_no_onclick_options - assert_deprecated ":disable_with option is deprecated and will be removed from Rails 4.0. Use :data-disable-with instead" do + 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...") @@ -392,7 +392,7 @@ class FormTagHelperTest < ActionView::TestCase end def test_submit_tag_with_confirmation_and_with_disable_with - assert_deprecated ":disable_with option is deprecated and will be removed from Rails 4.0. Use :data-disable-with instead" do + 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?") @@ -421,6 +421,15 @@ class FormTagHelperTest < ActionView::TestCase ) end + def test_button_tag_with_disable_with + assert_deprecated ":disable_with option is deprecated and will be removed from Rails 4.0. Use 'data-disable-with' instead" do + assert_dom_equal( + %(<button name="button" data-disable-with="Saving..." type="submit">Save</button>), + button_tag("Save", :type => "submit", :disable_with => "Saving...") + ) + end + end + def test_button_tag_with_reset_type assert_dom_equal( %(<button name="button" type="reset">Reset</button>), diff --git a/actionpack/test/template/url_helper_test.rb b/actionpack/test/template/url_helper_test.rb index b7f4a1c139..3a7cf9d8a3 100644 --- a/actionpack/test/template/url_helper_test.rb +++ b/actionpack/test/template/url_helper_test.rb @@ -82,7 +82,7 @@ class UrlHelperTest < ActiveSupport::TestCase end def test_button_to_with_javascript_disable_with - assert_deprecated ":disable_with option is deprecated and will be removed from Rails 4.0. Use :data-disable-with instead" do + assert_deprecated ":disable_with option is deprecated and will be removed from Rails 4.0. Use 'data-disable-with' instead" do assert_dom_equal( "<form method=\"post\" action=\"http://www.example.com\" class=\"button_to\"><div><input data-disable-with=\"Greeting...\" type=\"submit\" value=\"Hello\" /></div></form>", button_to("Hello", "http://www.example.com", :disable_with => "Greeting...") @@ -102,7 +102,7 @@ class UrlHelperTest < ActiveSupport::TestCase end def test_button_to_with_remote_and_javascript_disable_with - assert_deprecated ":disable_with option is deprecated and will be removed from Rails 4.0. Use :data-disable-with instead" do + assert_deprecated ":disable_with option is deprecated and will be removed from Rails 4.0. Use 'data-disable-with' instead" do assert_dom_equal( "<form method=\"post\" action=\"http://www.example.com\" class=\"button_to\" data-remote=\"true\"><div><input data-disable-with=\"Greeting...\" type=\"submit\" value=\"Hello\" /></div></form>", button_to("Hello", "http://www.example.com", :remote => true, :disable_with => "Greeting...") @@ -111,7 +111,7 @@ class UrlHelperTest < ActiveSupport::TestCase end def test_button_to_with_remote_and_javascript_confirm_and_javascript_disable_with - assert_deprecated ":disable_with option is deprecated and will be removed from Rails 4.0. Use :data-disable-with instead" do + assert_deprecated ":disable_with option is deprecated and will be removed from Rails 4.0. Use 'data-disable-with' instead" do assert_dom_equal( "<form method=\"post\" action=\"http://www.example.com\" class=\"button_to\" data-remote=\"true\"><div><input data-disable-with=\"Greeting...\" data-confirm=\"Are you sure?\" type=\"submit\" value=\"Hello\" /></div></form>", button_to("Hello", "http://www.example.com", :remote => true, :confirm => "Are you sure?", :disable_with => "Greeting...") |