]> git.openstreetmap.org Git - rails.git/blobdiff - test/unit/diary_entry_test.rb
Turn on mass assignment protection
[rails.git] / test / unit / diary_entry_test.rb
index d645aa860d2a3ce457ea2b756a1ef5f01351918f..0e080210b31827b07479a6495c1250bcec923037 100644 (file)
@@ -25,8 +25,8 @@ class DiaryEntryTest < ActiveSupport::TestCase
   end
   
   def diary_entry_valid(attrs, result = true)
-    entry = DiaryEntry.new(diary_entries(:normal_user_entry_1).attributes)
-    entry.attributes = attrs
+    entry = DiaryEntry.new(diary_entries(:normal_user_entry_1).attributes, :without_protection => true)
+    entry.assign_attributes(attrs, :without_protection => true)
     assert_equal result, entry.valid?, "Expected #{attrs.inspect} to be #{result}"
   end  
 end