Skip to content
Browse files

Add regression test to #12343

  • Loading branch information...
1 parent 1e81002 commit 43d600ee20ea20e0ef65670f95186b74633fc090 @rafaelfranca rafaelfranca committed Sep 24, 2013
Showing with 5 additions and 0 deletions.
  1. +5 −0 activerecord/test/cases/forbidden_attributes_protection_test.rb
View
5 activerecord/test/cases/forbidden_attributes_protection_test.rb
@@ -61,4 +61,9 @@ def test_regular_hash_should_still_be_used_for_mass_assignment
assert_equal 'Guille', person.first_name
assert_equal 'm', person.gender
end
+
+ def test_blank_attributes_should_not_raise
+ person = Person.new
+ assert_nil person.assign_attributes(ProtectedParams.new({}))
+ end
end

2 comments on commit 43d600e

@wangjohn

Thanks for this! I was trying to figure out a good way to incorporated ActionController::Parameters in the Active Record tests but wasn't able to find a good way to do it.

@rafaelfranca
Ruby on Rails member

You are welcome 😄

Please sign in to comment.
Something went wrong with that request. Please try again.