From 76e3e14db2bd4dc8be742180c1b5ad5a4efa86ca Mon Sep 17 00:00:00 2001 From: Amos King Date: Thu, 29 May 2008 17:04:15 -0700 Subject: [PATCH] added test for verify :method => :post, :redirect_to => :back when referrer is set. --- actionpack/test/controller/verification_test.rb | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/actionpack/test/controller/verification_test.rb b/actionpack/test/controller/verification_test.rb index f4634cf..8a3fccc 100644 --- a/actionpack/test/controller/verification_test.rb +++ b/actionpack/test/controller/verification_test.rb @@ -117,9 +117,15 @@ class VerificationTest < Test::Unit::TestCase ActionController::Routing::Routes.add_named_route :foo, '/foo', :controller => 'test', :action => 'foo' end - def test_using_symbol_back_redirects_to_back + def test_using_symbol_back_with_no_referrer assert_raise(ActionController::RedirectBackError) {get :guarded_with_back} end + + def test_using_symbol_back_redirects_to_referrer + @request.env["HTTP_REFERER"] = "/foo" + get :guarded_with_back + assert_redirected_to '/foo' + end def test_no_deprecation_warning_for_named_route assert_not_deprecated do -- 1.5.5.1.316.g377d9