From cfe36d16097ba6c4e64d91026aef02bca25f73db Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Tue, 16 Oct 2007 05:06:55 +0000 Subject: Test link_to 'back', :back git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7933 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/template/url_helper_test.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'actionpack/test/template') 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 @@ -109,6 +109,16 @@ class UrlHelperTest < Test::Unit::TestCase 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_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) -- cgit v1.2.3