final corrections to the mass-assignment security tests

This commit is contained in:
Josh Kalderimis
2011-04-27 20:57:56 +02:00
parent c992045da3
commit e85dbd8f06

View File

@@ -534,21 +534,21 @@ class PersistencesTest < ActiveRecord::TestCase
def test_update_attributes_as_admin
person = TightPerson.create
person.update_attributes!({ "first_name" => 'Josh', "gender" => 'male', "comments" => 'from NZ' }, :as => :admin)
person.update_attributes!({ "first_name" => 'Josh', "gender" => 'm', "comments" => 'from NZ' }, :as => :admin)
person.reload
assert_equal 'Josh', person.first_name
assert_equal 'male', person.gender
assert_equal 'm', person.gender
assert_equal 'from NZ', person.comments
end
def test_update_attributes_as_without_protection
person = TightPerson.create
person.update_attributes!({ "first_name" => 'Josh', "gender" => 'male', "comments" => 'from NZ' }, :without_protection => true)
person.update_attributes!({ "first_name" => 'Josh', "gender" => 'm', "comments" => 'from NZ' }, :without_protection => true)
person.reload
assert_equal 'Josh', person.first_name
assert_equal 'male', person.gender
assert_equal 'm', person.gender
assert_equal 'from NZ', person.comments
end