From d5d717161d853d8d7240da59b41a879bdac6e982 Mon Sep 17 00:00:00 2001 From: Nicolas Sanguinetti Date: Wed, 14 Apr 2010 21:44:28 -0300 Subject: Allow :remote => false to be passed to link_to And add tests for `button_to` and `form_tag` which currently behave as expected, so we avoid a regression. Signed-off-by: wycats --- actionpack/test/template/form_tag_helper_test.rb | 6 ++++++ actionpack/test/template/url_helper_test.rb | 14 ++++++++++++++ 2 files changed, 20 insertions(+) (limited to 'actionpack/test') diff --git a/actionpack/test/template/form_tag_helper_test.rb b/actionpack/test/template/form_tag_helper_test.rb index ef612b879b..b4f3f82b29 100644 --- a/actionpack/test/template/form_tag_helper_test.rb +++ b/actionpack/test/template/form_tag_helper_test.rb @@ -62,6 +62,12 @@ class FormTagHelperTest < ActionView::TestCase assert_dom_equal expected, actual end + def test_form_tag_with_remote_false + actual = form_tag({}, :remote => false) + expected = %(
) + assert_dom_equal expected, actual + end + def test_form_tag_with_block_in_erb output_buffer = form_tag("http://example.com") { concat "Hello world!" } diff --git a/actionpack/test/template/url_helper_test.rb b/actionpack/test/template/url_helper_test.rb index 5120870f50..299d6dd5bd 100644 --- a/actionpack/test/template/url_helper_test.rb +++ b/actionpack/test/template/url_helper_test.rb @@ -103,6 +103,13 @@ class UrlHelperTest < ActiveSupport::TestCase ) end + def test_button_to_with_remote_false + assert_dom_equal( + "
", + button_to("Hello", "http://www.example.com", :remote => false) + ) + end + def test_button_to_enabled_disabled assert_dom_equal( "
", @@ -205,6 +212,13 @@ class UrlHelperTest < ActiveSupport::TestCase ) end + def test_link_to_with_remote_false + assert_dom_equal( + "Hello", + link_to("Hello", "http://www.example.com", :remote => false) + ) + end + def test_link_tag_using_post_javascript assert_dom_equal( "Hello", -- cgit v1.2.3