aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2013-01-15 17:28:29 -0800
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-01-15 17:28:29 -0800
commite42b5f99eb04403aa3a850c4f05a609ee6a7846d (patch)
tree849d3320b5ddba99771580ef49edb93434d867f4 /actionpack/test/controller
parentcfdd5cbbab68cf34c3fc2248822498191376fe6d (diff)
parent8e221127abf5262183c20e981f7cf1ff4bfe1a4f (diff)
downloadrails-e42b5f99eb04403aa3a850c4f05a609ee6a7846d.tar.gz
rails-e42b5f99eb04403aa3a850c4f05a609ee6a7846d.tar.bz2
rails-e42b5f99eb04403aa3a850c4f05a609ee6a7846d.zip
Merge pull request #8958 from balexand/strong_parameters_exception_handling
Strong parameters exception handling
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/required_params_test.rb15
1 files changed, 6 insertions, 9 deletions
diff --git a/actionpack/test/controller/required_params_test.rb b/actionpack/test/controller/required_params_test.rb
index 661bcb3945..2898adee72 100644
--- a/actionpack/test/controller/required_params_test.rb
+++ b/actionpack/test/controller/required_params_test.rb
@@ -11,20 +11,17 @@ class ActionControllerRequiredParamsTest < ActionController::TestCase
tests BooksController
test "missing required parameters will raise exception" do
- post :create, { magazine: { name: "Mjallo!" } }
- assert_response :bad_request
+ assert_raise (ActionController::ParameterMissing) do
+ post :create, { magazine: { name: "Mjallo!" } }
+ end
- post :create, { book: { title: "Mjallo!" } }
- assert_response :bad_request
+ assert_raise (ActionController::ParameterMissing) do
+ post :create, { book: { title: "Mjallo!" } }
+ end
end
test "required parameters that are present will not raise" do
post :create, { book: { name: "Mjallo!" } }
assert_response :ok
end
-
- test "missing parameters will be mentioned in the return" do
- post :create, { magazine: { name: "Mjallo!" } }
- assert_equal "Required parameter missing: book", response.body
- end
end