diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-04-27 12:07:36 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-04-27 12:07:36 -0700 |
commit | 1cd5a084c1bb92d8acf618368d2450a084b69345 (patch) | |
tree | 6c3d2a97656246a07ffb66871282c19831073410 | |
parent | c992045da3d7f1767ad3dff0fd9d5b275e4e3e62 (diff) | |
parent | e85dbd8f06873185d08ca43647e8485e7d4eddf2 (diff) | |
download | rails-1cd5a084c1bb92d8acf618368d2450a084b69345.tar.gz rails-1cd5a084c1bb92d8acf618368d2450a084b69345.tar.bz2 rails-1cd5a084c1bb92d8acf618368d2450a084b69345.zip |
Merged pull request #325 from joshk/mass_assignment_tests_fixed.
final corrections to the mass-assignment security tests
-rw-r--r-- | activerecord/test/cases/persistence_test.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/test/cases/persistence_test.rb b/activerecord/test/cases/persistence_test.rb index 7891ccfeef..5567602a26 100644 --- a/activerecord/test/cases/persistence_test.rb +++ b/activerecord/test/cases/persistence_test.rb @@ -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 |