aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test
diff options
context:
space:
mode:
authorAttila Domokos <adomokos@gmail.com>2014-02-02 10:27:18 -0600
committerAttila Domokos <adomokos@gmail.com>2014-02-02 10:27:18 -0600
commit4b4db54e6b48813b24c807b0156eb58bc4694cd9 (patch)
tree89cb8a8129ccddc036fb396471c96a4bc7a5abf7 /actionview/test
parent4ac114471cc14de44b77ced3dd4a0676c13b818b (diff)
downloadrails-4b4db54e6b48813b24c807b0156eb58bc4694cd9.tar.gz
rails-4b4db54e6b48813b24c807b0156eb58bc4694cd9.tar.bz2
rails-4b4db54e6b48813b24c807b0156eb58bc4694cd9.zip
Adding an documentation example and a test to button_to with path
I did not see in the docs that `button_to` supports not only URLs but paths as well. I documented this functionality with a unit tests and added an example to the docs as well.
Diffstat (limited to 'actionview/test')
-rw-r--r--actionview/test/template/url_helper_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/actionview/test/template/url_helper_test.rb b/actionview/test/template/url_helper_test.rb
index deba33510a..7e978e15d2 100644
--- a/actionview/test/template/url_helper_test.rb
+++ b/actionview/test/template/url_helper_test.rb
@@ -56,6 +56,13 @@ class UrlHelperTest < ActiveSupport::TestCase
assert_dom_equal %{<form method="post" action="http://www.example.com" class="button_to"><div><input type="submit" value="Hello" /></div></form>}, button_to("Hello", "http://www.example.com")
end
+ def test_button_to_with_path
+ assert_dom_equal(
+ %{<form method="post" action="/article/Hello" class="button_to"><div><input type="submit" value="Hello" /></div></form>},
+ button_to("Hello", article_path("Hello".html_safe))
+ )
+ end
+
def test_button_to_with_straight_url_and_request_forgery
self.request_forgery = true