diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-10-16 05:06:55 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-10-16 05:06:55 +0000 |
commit | cfe36d16097ba6c4e64d91026aef02bca25f73db (patch) | |
tree | c60e4aeb41b792e5549614bea824116c9228e6be /actionpack/test | |
parent | 9b6207c3d0596599078b4171caa71b6e7c49ebc9 (diff) | |
download | rails-cfe36d16097ba6c4e64d91026aef02bca25f73db.tar.gz rails-cfe36d16097ba6c4e64d91026aef02bca25f73db.tar.bz2 rails-cfe36d16097ba6c4e64d91026aef02bca25f73db.zip |
Test link_to 'back', :back
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7933 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/template/url_helper_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/test/template/url_helper_test.rb b/actionpack/test/template/url_helper_test.rb index 5c7abdfe56..ee75965be9 100644 --- a/actionpack/test/template/url_helper_test.rb +++ b/actionpack/test/template/url_helper_test.rb @@ -113,6 +113,16 @@ class UrlHelperTest < Test::Unit::TestCase @controller.request = RequestMock.new("http://www.example.com/weblog/show", nil, nil, {'HTTP_REFERER' => 'http://www.example.com/referer'}) assert_dom_equal "<a href=\"http://www.example.com/referer\">go back</a>", link_to('go back', :back) end + + def test_link_tag_with_back_and_no_referer + @controller.request = RequestMock.new("http://www.example.com/weblog/show", nil, nil, {}) + assert_dom_equal "<a href=\"javascript:history.back()\">go back</a>", link_to('go back', :back) + end + + def test_link_tag_with_back + @controller.request = RequestMock.new("http://www.example.com/weblog/show", nil, nil, {'HTTP_REFERER' => 'http://www.example.com/referer'}) + assert_dom_equal "<a href=\"http://www.example.com/referer\">go back</a>", link_to('go back', :back) + end def test_link_tag_with_back_and_no_referer @controller.request = RequestMock.new("http://www.example.com/weblog/show", nil, nil, {}) |