From e03f13c5538e38b501014fd5702309bcd7e16cbb Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Fri, 30 Nov 2007 21:04:57 +0000 Subject: Fixed that verification violations with no specified action didn't halt the chain (now they do with a 400 Bad Request) [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8245 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/test/controller/verification_test.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'actionpack/test/controller/verification_test.rb') diff --git a/actionpack/test/controller/verification_test.rb b/actionpack/test/controller/verification_test.rb index bbcd7d59d8..e61bd5cccb 100644 --- a/actionpack/test/controller/verification_test.rb +++ b/actionpack/test/controller/verification_test.rb @@ -37,6 +37,8 @@ class VerificationTest < Test::Unit::TestCase verify :only => :guarded_one_for_named_route_test, :params => "one", :redirect_to => :foo_url + verify :only => :no_default_action, :params => "santa" + def guarded_one render :text => "#{params[:one]}" end @@ -89,6 +91,10 @@ class VerificationTest < Test::Unit::TestCase render :text => "Was a post!" end + def no_default_action + # Will never run + end + protected def rescue_action(e) raise end @@ -229,6 +235,11 @@ class VerificationTest < Test::Unit::TestCase assert_equal "Was a post!", @response.body end + def test_default_failure_should_be_a_bad_request + post :no_default_action + assert_response :bad_request + end + def test_guarded_post_and_calls_render_fails_and_sets_allow_header get :must_be_post assert_response 405 -- cgit v1.2.3