aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/verification_test.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2007-11-30 21:04:57 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2007-11-30 21:04:57 +0000
commite03f13c5538e38b501014fd5702309bcd7e16cbb (patch)
treec5e266e897a885c6dab7aa657c13284c9dc2c285 /actionpack/test/controller/verification_test.rb
parentb6d255559eeead2b95f6c5e4035f4b82d2b88355 (diff)
downloadrails-e03f13c5538e38b501014fd5702309bcd7e16cbb.tar.gz
rails-e03f13c5538e38b501014fd5702309bcd7e16cbb.tar.bz2
rails-e03f13c5538e38b501014fd5702309bcd7e16cbb.zip
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
Diffstat (limited to 'actionpack/test/controller/verification_test.rb')
-rw-r--r--actionpack/test/controller/verification_test.rb11
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