diff options
author | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-10-29 13:57:00 -0200 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-10-29 13:57:00 -0200 |
commit | 008154e23705e732f5fa5292aa60605efb92d163 (patch) | |
tree | 34c7af070fcda2420814596f383738b2ec4eb68b | |
parent | d1c95d912ec39e7e374aee605a1d6fb11f8521d7 (diff) | |
download | rails-008154e23705e732f5fa5292aa60605efb92d163.tar.gz rails-008154e23705e732f5fa5292aa60605efb92d163.tar.bz2 rails-008154e23705e732f5fa5292aa60605efb92d163.zip |
Fix failing tests and use new hash style in deprecation messages
6 files changed, 28 insertions, 28 deletions
diff --git a/actionpack/lib/action_view/helpers/form_options_helper.rb b/actionpack/lib/action_view/helpers/form_options_helper.rb index 6b3d80cbf0..dec87013d3 100644 --- a/actionpack/lib/action_view/helpers/form_options_helper.rb +++ b/actionpack/lib/action_view/helpers/form_options_helper.rb @@ -519,7 +519,7 @@ module ActionView else prompt = options options = {} - message = "Passing the prompt to grouped_options_for_select as an argument is deprecated. " / + message = "Passing the prompt to grouped_options_for_select as an argument is deprecated. " \ "Please use an options hash like `{ prompt: #{prompt.inspect} }`." ActiveSupport::Deprecation.warn(message, caller) end diff --git a/actionpack/lib/action_view/helpers/form_tag_helper.rb b/actionpack/lib/action_view/helpers/form_tag_helper.rb index c92b38e2b9..11bc0cbec8 100644 --- a/actionpack/lib/action_view/helpers/form_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/form_tag_helper.rb @@ -425,16 +425,16 @@ module ActionView options = options.stringify_keys if disable_with = options.delete("disable_with") - message = ":disable_with option is deprecated and will be removed from Rails 4.1. " / - "Use ':data => { :disable_with => \'Text\' }' instead." + message = ":disable_with option is deprecated and will be removed from Rails 4.1. " \ + "Use 'data: { disable_with: \'Text\' }' instead." ActiveSupport::Deprecation.warn(message, caller) options["data-disable-with"] = disable_with end if confirm = options.delete("confirm") - message = ":confirm option is deprecated and will be removed from Rails 4.1. " / - "Use ':data => { :confirm => \'Text\' }' instead'." + message = ":confirm option is deprecated and will be removed from Rails 4.1. " \ + "Use 'data: { confirm: \'Text\' }' instead'." ActiveSupport::Deprecation.warn(message, caller) options["data-confirm"] = confirm @@ -487,16 +487,16 @@ module ActionView options = options.stringify_keys if disable_with = options.delete("disable_with") - message = ":disable_with option is deprecated and will be removed from Rails 4.1. " / - "Use ':data => { :disable_with => \'Text\' }' instead." + message = ":disable_with option is deprecated and will be removed from Rails 4.1. " \ + "Use 'data: { disable_with: \'Text\' }' instead." ActiveSupport::Deprecation.warn(message, caller) options["data-disable-with"] = disable_with end if confirm = options.delete("confirm") - message = ":confirm option is deprecated and will be removed from Rails 4.1. " / - "Use ':data => { :confirm => \'Text\' }' instead'." + message = ":confirm option is deprecated and will be removed from Rails 4.1. " \ + "Use 'data: { confirm: \'Text\' }' instead'." ActiveSupport::Deprecation.warn(message, caller) options["data-confirm"] = confirm @@ -541,8 +541,8 @@ module ActionView options = options.stringify_keys if confirm = options.delete("confirm") - message = ":confirm option is deprecated and will be removed from Rails 4.1. " / - "Use ':data => { :confirm => \'Text\' }' instead'." + message = ":confirm option is deprecated and will be removed from Rails 4.1. " \ + "Use 'data: { confirm: \'Text\' }' instead'." ActiveSupport::Deprecation.warn(message, caller) options["data-confirm"] = confirm diff --git a/actionpack/lib/action_view/helpers/url_helper.rb b/actionpack/lib/action_view/helpers/url_helper.rb index 4d6367e66a..2a1dd86e0a 100644 --- a/actionpack/lib/action_view/helpers/url_helper.rb +++ b/actionpack/lib/action_view/helpers/url_helper.rb @@ -577,8 +577,8 @@ module ActionView method = html_options.delete('method') if confirm - message = ":confirm option is deprecated and will be removed from Rails 4.1. " / - "Use ':data => { :confirm => \'Text\' }' instead." + message = ":confirm option is deprecated and will be removed from Rails 4.1. " \ + "Use 'data: { confirm: \'Text\' }' instead." ActiveSupport::Deprecation.warn(message, caller) html_options["data-confirm"] = confirm @@ -587,8 +587,8 @@ module ActionView add_method_to_attributes!(html_options, method) if method if disable_with - message = ":disable_with option is deprecated and will be removed from Rails 4.1. " / - "Use ':data => { :disable_with => \'Text\' }' instead." + message = ":disable_with option is deprecated and will be removed from Rails 4.1. " \ + "Use 'data: { disable_with: \'Text\' }' instead." ActiveSupport::Deprecation.warn(message, caller) html_options["data-disable-with"] = disable_with diff --git a/actionpack/lib/action_view/template/resolver.rb b/actionpack/lib/action_view/template/resolver.rb index 32a9152707..086cc0bacc 100644 --- a/actionpack/lib/action_view/template/resolver.rb +++ b/actionpack/lib/action_view/template/resolver.rb @@ -235,7 +235,7 @@ module ActionView extension = pieces.pop unless extension - message = "The file #{path} did not specify a template handler. The default is currently ERB, " / + message = "The file #{path} did not specify a template handler. The default is currently ERB, " \ "but will change to RAW in the future." ActiveSupport::Deprecation.warn(message, caller) end diff --git a/actionpack/test/template/form_tag_helper_test.rb b/actionpack/test/template/form_tag_helper_test.rb index 945dff2a29..0a94fa079b 100644 --- a/actionpack/test/template/form_tag_helper_test.rb +++ b/actionpack/test/template/form_tag_helper_test.rb @@ -411,7 +411,7 @@ class FormTagHelperTest < ActionView::TestCase end def test_submit_tag_with_deprecated_confirmation - assert_deprecated ":confirm option is deprecated and will be removed from Rails 4.1. Use ':data => { :confirm => \'Text\' }' instead" do + assert_deprecated ":confirm option is deprecated and will be removed from Rails 4.1. Use 'data: { confirm: \'Text\' }' instead" do assert_dom_equal( %(<input name='commit' type='submit' value='Save' data-confirm="Are you sure?" />), submit_tag("Save", :confirm => "Are you sure?") @@ -478,7 +478,7 @@ class FormTagHelperTest < ActionView::TestCase end def test_button_tag_with_deprecated_confirmation - assert_deprecated ":confirm option is deprecated and will be removed from Rails 4.1. Use ':data => { :confirm => \'Text\' }' instead" do + assert_deprecated ":confirm option is deprecated and will be removed from Rails 4.1. Use 'data: { confirm: \'Text\' }' instead" do assert_dom_equal( %(<button name="button" type="submit" data-confirm="Are you sure?">Save</button>), button_tag("Save", :type => "submit", :confirm => "Are you sure?") @@ -494,7 +494,7 @@ class FormTagHelperTest < ActionView::TestCase end def test_image_submit_tag_with_deprecated_confirmation - assert_deprecated ":confirm option is deprecated and will be removed from Rails 4.1. Use ':data => { :confirm => \'Text\' }' instead" do + assert_deprecated ":confirm option is deprecated and will be removed from Rails 4.1. Use 'data: { confirm: \'Text\' }' instead" do assert_dom_equal( %(<input type="image" src="/images/save.gif" data-confirm="Are you sure?" />), image_submit_tag("save.gif", :confirm => "Are you sure?") diff --git a/actionpack/test/template/url_helper_test.rb b/actionpack/test/template/url_helper_test.rb index bbfdf7f944..1bb625213d 100644 --- a/actionpack/test/template/url_helper_test.rb +++ b/actionpack/test/template/url_helper_test.rb @@ -95,7 +95,7 @@ class UrlHelperTest < ActiveSupport::TestCase end def test_button_to_with_deprecated_confirm - assert_deprecated ":confirm option is deprecated and will be removed from Rails 4.1. Use ':data => { :confirm => \'Text\' }' instead" do + assert_deprecated ":confirm option is deprecated and will be removed from Rails 4.1. Use 'data: { confirm: \'Text\' }' instead" do assert_dom_equal( %{<form method="post" action="http://www.example.com" class="button_to"><div><input data-confirm="Are you sure?" type="submit" value="Hello" /></div></form>}, button_to("Hello", "http://www.example.com", confirm: "Are you sure?") @@ -111,7 +111,7 @@ class UrlHelperTest < ActiveSupport::TestCase 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_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...") @@ -134,7 +134,7 @@ class UrlHelperTest < ActiveSupport::TestCase end def test_button_to_with_remote_and_javascript_with_deprecated_confirm - assert_deprecated ":confirm option is deprecated and will be removed from Rails 4.1. Use ':data => { :confirm => \'Text\' }' instead" do + assert_deprecated ":confirm option is deprecated and will be removed from Rails 4.1. Use 'data: { confirm: \'Text\' }' instead" do assert_dom_equal( %{<form method="post" action="http://www.example.com" class="button_to" data-remote="true"><div><input data-confirm="Are you sure?" type="submit" value="Hello" /></div></form>}, button_to("Hello", "http://www.example.com", remote: true, confirm: "Are you sure?") @@ -150,7 +150,7 @@ class UrlHelperTest < ActiveSupport::TestCase 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_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...") @@ -267,19 +267,19 @@ class UrlHelperTest < ActiveSupport::TestCase end def test_link_tag_with_deprecated_confirm - assert_deprecated ":confirm option is deprecated and will be removed from Rails 4.1. Use ':data => { :confirm => \'Text\' }' instead" do + assert_deprecated ":confirm option is deprecated and will be removed from Rails 4.1. Use 'data: { confirm: \'Text\' }' instead" do assert_dom_equal( %{<a href="http://www.example.com" data-confirm="Are you sure?">Hello</a>}, link_to("Hello", "http://www.example.com", confirm: "Are you sure?") ) end - assert_deprecated ":confirm option is deprecated and will be removed from Rails 4.1. Use ':data => { :confirm => \'Text\' }' instead" do + assert_deprecated ":confirm option is deprecated and will be removed from Rails 4.1. Use 'data: { confirm: \'Text\' }' instead" do assert_dom_equal( %{<a href="http://www.example.com" data-confirm="You cant possibly be sure, can you?">Hello</a>}, link_to("Hello", "http://www.example.com", confirm: "You cant possibly be sure, can you?") ) end - assert_deprecated ":confirm option is deprecated and will be removed from Rails 4.1. Use ':data => { :confirm => \'Text\' }' instead" do + assert_deprecated ":confirm option is deprecated and will be removed from Rails 4.1. Use 'data: { confirm: \'Text\' }' instead" do assert_dom_equal( %{<a href="http://www.example.com" data-confirm="You cant possibly be sure,\n can you?">Hello</a>}, link_to("Hello", "http://www.example.com", confirm: "You cant possibly be sure,\n can you?") @@ -351,7 +351,7 @@ class UrlHelperTest < ActiveSupport::TestCase end def test_link_tag_using_post_javascript_and_with_deprecated_confirm - assert_deprecated ":confirm option is deprecated and will be removed from Rails 4.1. Use ':data => { :confirm => \'Text\' }' instead" do + assert_deprecated ":confirm option is deprecated and will be removed from Rails 4.1. Use 'data: { confirm: \'Text\' }' instead" do assert_dom_equal( %{<a href="http://www.example.com" data-method="post" rel="nofollow" data-confirm="Are you serious?">Hello</a>}, link_to("Hello", "http://www.example.com", method: :post, confirm: "Are you serious?") @@ -367,7 +367,7 @@ class UrlHelperTest < ActiveSupport::TestCase end def test_link_tag_using_delete_javascript_and_href_and_with_deprecated_confirm - assert_deprecated ":confirm option is deprecated and will be removed from Rails 4.1. Use ':data => { :confirm => \'Text\' }' instead" do + assert_deprecated ":confirm option is deprecated and will be removed from Rails 4.1. Use 'data: { confirm: \'Text\' }' instead" do assert_dom_equal( %{<a href="\#" rel="nofollow" data-confirm="Are you serious?" data-method="delete">Destroy</a>}, link_to("Destroy", "http://www.example.com", method: :delete, href: '#', confirm: "Are you serious?") |