Skip to content

Commit

Permalink
Merged pull request rails#325 from joshk/mass_assignment_tests_fixed.
Browse files Browse the repository at this point in the history
final corrections to the mass-assignment security tests
  • Loading branch information
tenderlove committed Apr 27, 2011
2 parents 9f6cafd + 78e581b commit e190569
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions activerecord/test/cases/persistence_test.rb
Expand Up @@ -492,7 +492,7 @@ def test_update_attributes
end

def test_update_attributes_as_admin
person = TightPerson.create
person = TightPerson.create({ "first_name" => 'Joshua' })
person.update_attributes({ "first_name" => 'Josh', "gender" => 'm', "comments" => 'from NZ' }, :as => :admin)
person.reload

Expand All @@ -501,8 +501,8 @@ def test_update_attributes_as_admin
assert_equal 'from NZ', person.comments
end

def test_update_attributes_as_without_protection
person = TightPerson.create
def test_update_attributes_without_protection
person = TightPerson.create({ "first_name" => 'Joshua' })
person.update_attributes({ "first_name" => 'Josh', "gender" => 'm', "comments" => 'from NZ' }, :without_protection => true)
person.reload

Expand Down Expand Up @@ -532,8 +532,8 @@ def test_update_attributes!
Reply.reset_callbacks(:validate)
end

def test_update_attributes_as_admin
person = TightPerson.create
def test_update_attributes_with_bang_as_admin
person = TightPerson.create({ "first_name" => 'Joshua' })
person.update_attributes!({ "first_name" => 'Josh', "gender" => 'm', "comments" => 'from NZ' }, :as => :admin)
person.reload

Expand All @@ -542,8 +542,8 @@ def test_update_attributes_as_admin
assert_equal 'from NZ', person.comments
end

def test_update_attributes_as_without_protection
person = TightPerson.create
def test_update_attributestes_with_bang_without_protection
person = TightPerson.create({ "first_name" => 'Joshua' })
person.update_attributes!({ "first_name" => 'Josh', "gender" => 'm', "comments" => 'from NZ' }, :without_protection => true)
person.reload

Expand Down

0 comments on commit e190569

Please sign in to comment.