aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/template/url_helper_test.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2006-09-03 15:59:18 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2006-09-03 15:59:18 +0000
commita769b88819ac1ad1d89a1f9138bf1546091d3744 (patch)
tree756135df5c501075718f8529c47571268276c24c /actionpack/test/template/url_helper_test.rb
parentf6339eb17710ce81117e06725a4403e33a934d24 (diff)
downloadrails-a769b88819ac1ad1d89a1f9138bf1546091d3744.tar.gz
rails-a769b88819ac1ad1d89a1f9138bf1546091d3744.tar.bz2
rails-a769b88819ac1ad1d89a1f9138bf1546091d3744.zip
button_to accepts :method so you can PUT and DELETE with it. Closes #6005.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4914 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test/template/url_helper_test.rb')
-rw-r--r--actionpack/test/template/url_helper_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/actionpack/test/template/url_helper_test.rb b/actionpack/test/template/url_helper_test.rb
index 4d57bc65be..77ca8094f7 100644
--- a/actionpack/test/template/url_helper_test.rb
+++ b/actionpack/test/template/url_helper_test.rb
@@ -59,6 +59,20 @@ class UrlHelperTest < Test::Unit::TestCase
button_to("Hello", "http://www.example.com", :disabled => true)
)
end
+
+ def test_button_to_with_method_delete
+ assert_dom_equal(
+ "<form method=\"post\" action=\"http://www.example.com\" class=\"button-to\"><div><input type=\"hidden\" name=\"_method\" value=\"delete\" /><input type=\"submit\" value=\"Hello\" /></div></form>",
+ button_to("Hello", "http://www.example.com", :method => :delete)
+ )
+ end
+
+ def test_button_to_with_method_get
+ assert_dom_equal(
+ "<form method=\"get\" action=\"http://www.example.com\" class=\"button-to\"><div><input type=\"submit\" value=\"Hello\" /></div></form>",
+ button_to("Hello", "http://www.example.com", :method => :get)
+ )
+ end
def test_link_tag_with_straight_url
assert_dom_equal "<a href=\"http://www.example.com\">Hello</a>", link_to("Hello", "http://www.example.com")