diff options
author | Carlos Galdino + Rafael Mendonça França <rafael.franca+carlos.galdino@plataformatec.com.br> | 2012-07-21 16:19:40 -0300 |
---|---|---|
committer | Carlos Galdino + Rafael Mendonça França <rafael.franca+carlos.galdino@plataformatec.com.br> | 2012-07-21 16:25:34 -0300 |
commit | 0106e5fe4436df1853a68c0ed792dc0cf3b9e1a4 (patch) | |
tree | a08a72637fe02cfc642a3b23a01a204c87e11d03 /actionpack/test/template/url_helper_test.rb | |
parent | 9345a116af134e6963cda261c448c9ecdb3832ea (diff) | |
download | rails-0106e5fe4436df1853a68c0ed792dc0cf3b9e1a4.tar.gz rails-0106e5fe4436df1853a68c0ed792dc0cf3b9e1a4.tar.bz2 rails-0106e5fe4436df1853a68c0ed792dc0cf3b9e1a4.zip |
Add back `:disable_with` and change deprecation horizon to 4.1
Diffstat (limited to 'actionpack/test/template/url_helper_test.rb')
-rw-r--r-- | actionpack/test/template/url_helper_test.rb | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/actionpack/test/template/url_helper_test.rb b/actionpack/test/template/url_helper_test.rb index 893197a115..cb6f378ecb 100644 --- a/actionpack/test/template/url_helper_test.rb +++ b/actionpack/test/template/url_helper_test.rb @@ -106,10 +106,19 @@ class UrlHelperTest < ActiveSupport::TestCase def test_button_to_with_javascript_disable_with 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", 'data-disable-with' => "Greeting...") + button_to("Hello", "http://www.example.com", :data => { :disable_with => "Greeting..." }) ) end + def test_button_to_with_javascript_deprecated_disable_with + assert_deprecated ":disable_with option is deprecated and will be removed from Rails 4.1. Use ':data => { :disable_with => \'Text\' }' 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...") + ) + end + end + def test_button_to_with_remote_and_form_options assert_dom_equal "<form method=\"post\" action=\"http://www.example.com\" class=\"custom-class\" data-remote=\"true\" data-type=\"json\"><div><input type=\"submit\" value=\"Hello\" /></div></form>", button_to("Hello", "http://www.example.com", :remote => true, :form => { :class => "custom-class", "data-type" => "json" } ) end @@ -130,6 +139,22 @@ class UrlHelperTest < ActiveSupport::TestCase end end + def test_button_to_with_remote_and_javascript_disable_with + 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, :data => { :disable_with => "Greeting..." }) + ) + end + + def test_button_to_with_remote_and_javascript_deprecated_disable_with + assert_deprecated ":disable_with option is deprecated and will be removed from Rails 4.1. Use ':data => { :disable_with => \'Text\' }' 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...") + ) + end + end + def test_button_to_with_remote_false assert_dom_equal( "<form method=\"post\" action=\"http://www.example.com\" class=\"button_to\"><div><input type=\"submit\" value=\"Hello\" /></div></form>", |