Skip to content

Commit

Permalink
final corrections to the mass-assignment security tests
Browse files Browse the repository at this point in the history
  • Loading branch information
joshk committed Apr 27, 2011
1 parent c992045 commit e85dbd8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions activerecord/test/cases/persistence_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -534,21 +534,21 @@ def test_update_attributes!

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

Expand Down

0 comments on commit e85dbd8

Please sign in to comment.