diff options
Diffstat (limited to 'actionpack/test/controller/verification_test.rb')
-rw-r--r-- | actionpack/test/controller/verification_test.rb | 11 |
1 files changed, 11 insertions, 0 deletions
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 |