From 0b1d6fd9c87fd4a8459b0f560db626bf36a19618 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 28 May 2006 00:33:53 +0000 Subject: Added :method option to UrlHelper#link_to, which allows for using other verbs than GET for the link. This replaces the :post option, which is now deprecated. Example: link_to "Destroy", person_url(:id => person), :method => :delete [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4370 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/template/url_helper_test.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'actionpack/test/template') diff --git a/actionpack/test/template/url_helper_test.rb b/actionpack/test/template/url_helper_test.rb index 231e34751e..4d57bc65be 100644 --- a/actionpack/test/template/url_helper_test.rb +++ b/actionpack/test/template/url_helper_test.rb @@ -127,14 +127,21 @@ class UrlHelperTest < Test::Unit::TestCase def test_link_tag_using_post_javascript assert_dom_equal( - "Hello", + "Hello", link_to("Hello", "http://www.example.com", :post => true) ) end + + def test_link_tag_using_delete_javascript + assert_dom_equal( + "Destroy", + link_to("Destroy", "http://www.example.com", :method => :delete) + ) + end def test_link_tag_using_post_javascript_and_confirm assert_dom_equal( - "Hello", + "Hello", link_to("Hello", "http://www.example.com", :post => true, :confirm => "Are you serious?") ) end -- cgit v1.2.3