aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/forbidden_attributes_protection_test.rb
diff options
context:
space:
mode:
authorGuillermo Iguaran <guilleiguaran@gmail.com>2012-08-29 09:54:27 -0500
committerGuillermo Iguaran <guilleiguaran@gmail.com>2012-09-16 23:58:21 -0500
commit8cfe95d7194a1118f9950fe1d81a4e915cb929d6 (patch)
tree2d71aefbbda3e608627776693a0c915df58dbe20 /activerecord/test/cases/forbidden_attributes_protection_test.rb
parent978c568a7bffe354180aaefa471092182fed1015 (diff)
downloadrails-8cfe95d7194a1118f9950fe1d81a4e915cb929d6.tar.gz
rails-8cfe95d7194a1118f9950fe1d81a4e915cb929d6.tar.bz2
rails-8cfe95d7194a1118f9950fe1d81a4e915cb929d6.zip
Don't use assert_nothing_raised when assert_equal is used
Diffstat (limited to 'activerecord/test/cases/forbidden_attributes_protection_test.rb')
-rw-r--r--activerecord/test/cases/forbidden_attributes_protection_test.rb16
1 files changed, 6 insertions, 10 deletions
diff --git a/activerecord/test/cases/forbidden_attributes_protection_test.rb b/activerecord/test/cases/forbidden_attributes_protection_test.rb
index 89e9de261a..4706eaec2b 100644
--- a/activerecord/test/cases/forbidden_attributes_protection_test.rb
+++ b/activerecord/test/cases/forbidden_attributes_protection_test.rb
@@ -34,21 +34,17 @@ class ForbiddenAttributesProtectionTest < ActiveRecord::TestCase
def test_permitted_attributes_can_be_used_for_mass_assignment
params = ProtectedParams.new(first_name: 'Guille', gender: 'm')
params.permit!
- assert_nothing_raised do
- person = Person.new(params)
+ person = Person.new(params)
- assert_equal 'Guille', person.first_name
- assert_equal 'm', person.gender
- end
+ assert_equal 'Guille', person.first_name
+ assert_equal 'm', person.gender
end
def test_regular_hash_should_still_be_used_for_mass_assignment
- assert_nothing_raised do
- person = Person.new(first_name: 'Guille', gender: 'm')
+ person = Person.new(first_name: 'Guille', gender: 'm')
- assert_equal 'Guille', person.first_name
- assert_equal 'm', person.gender
- end
+ assert_equal 'Guille', person.first_name
+ assert_equal 'm', person.gender
end
def test_protected_attributes_cannot_be_used_for_mass_assignment