diff options
author | Clemens Kofler <clemens@railway.at> | 2008-07-19 13:06:43 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-07-19 13:06:43 -0500 |
commit | c98692abcfd3576ee5fcde3910330d1eb39a18a5 (patch) | |
tree | 97812fd62532a9881ce5327e7b0c80e470d8eceb /actionpack/test/template | |
parent | 938caf4e6b2448b45939d36824794ea0aa5e1804 (diff) | |
download | rails-c98692abcfd3576ee5fcde3910330d1eb39a18a5.tar.gz rails-c98692abcfd3576ee5fcde3910330d1eb39a18a5.tar.bz2 rails-c98692abcfd3576ee5fcde3910330d1eb39a18a5.zip |
Removed handling of string parameter in link_to to have all URL generation done by url_for
Signed-off-by: Joshua Peek <josh@joshpeek.com>
Diffstat (limited to 'actionpack/test/template')
-rw-r--r-- | actionpack/test/template/url_helper_test.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/actionpack/test/template/url_helper_test.rb b/actionpack/test/template/url_helper_test.rb index 91d5c6ffb5..867503fb29 100644 --- a/actionpack/test/template/url_helper_test.rb +++ b/actionpack/test/template/url_helper_test.rb @@ -28,6 +28,16 @@ class UrlHelperTest < ActionView::TestCase assert_equal "http://www.example.com?a=b&c=d", url_for("http://www.example.com?a=b&c=d") end + def test_url_for_with_back + @controller.request = RequestMock.new("http://www.example.com/weblog/show", nil, nil, {'HTTP_REFERER' => 'http://www.example.com/referer'}) + assert_equal 'http://www.example.com/referer', url_for(:back) + end + + def test_url_for_with_back_and_no_referer + @controller.request = RequestMock.new("http://www.example.com/weblog/show", nil, nil, {}) + assert_equal 'javascript:history.back()', url_for(:back) + end + # todo: missing test cases def test_button_to_with_straight_url 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") @@ -419,7 +429,6 @@ class LinkToUnlessCurrentWithControllerTest < ActionView::TestCase end end - class Workshop attr_accessor :id, :new_record |