From 9ab8d4d9edd9dd136b8ec0a77ce9512b4171fd52 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 22 Sep 2007 22:22:20 +0000 Subject: Improve the error message for assert_redirected_to (closes #7337) [sandofsky] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7578 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/template/url_helper_test.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'actionpack/test') diff --git a/actionpack/test/template/url_helper_test.rb b/actionpack/test/template/url_helper_test.rb index db1e226a7e..712b827c5c 100644 --- a/actionpack/test/template/url_helper_test.rb +++ b/actionpack/test/template/url_helper_test.rb @@ -108,6 +108,16 @@ class UrlHelperTest < Test::Unit::TestCase def test_link_tag_with_query_and_no_name assert_dom_equal "http://www.example.com?q1=v1&q2=v2", link_to(nil, "http://www.example.com?q1=v1&q2=v2") 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 "go back", 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 "go back", link_to('go back', :back) + end def test_link_tag_with_img assert_dom_equal "", link_to("", "http://www.example.com") -- cgit v1.2.3