diff options
author | Dmitry Polushkin <dmitry.polushkin@gmail.com> | 2011-09-15 09:39:26 +0100 |
---|---|---|
committer | Dmitry Polushkin <dmitry.polushkin@gmail.com> | 2011-09-15 09:39:26 +0100 |
commit | 9d54f8994d09db5435d6c234430ae13333928fb9 (patch) | |
tree | 12413c10ed50c181f5bea0980edca998e72969bb /activerecord/test/cases/persistence_test.rb | |
parent | edd2f21e8095fe4a38e812025b4d9fd0e0cc28f1 (diff) | |
parent | da7f0426ec7b0aa053489633c2a8a3da6423654f (diff) | |
download | rails-9d54f8994d09db5435d6c234430ae13333928fb9.tar.gz rails-9d54f8994d09db5435d6c234430ae13333928fb9.tar.bz2 rails-9d54f8994d09db5435d6c234430ae13333928fb9.zip |
Merge branch 'master' of git://github.com/rails/rails
Diffstat (limited to 'activerecord/test/cases/persistence_test.rb')
-rw-r--r-- | activerecord/test/cases/persistence_test.rb | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/activerecord/test/cases/persistence_test.rb b/activerecord/test/cases/persistence_test.rb index 9cd07fa8a5..adfd8e83a1 100644 --- a/activerecord/test/cases/persistence_test.rb +++ b/activerecord/test/cases/persistence_test.rb @@ -202,9 +202,12 @@ class PersistencesTest < ActiveRecord::TestCase end def test_create_columns_not_equal_attributes - topic = Topic.new - topic.title = 'Another New Topic' - topic.send :write_attribute, 'does_not_exist', 'test' + topic = Topic.allocate.init_with( + 'attributes' => { + 'title' => 'Another New Topic', + 'does_not_exist' => 'test' + } + ) assert_nothing_raised { topic.save } end @@ -249,9 +252,11 @@ class PersistencesTest < ActiveRecord::TestCase topic.title = "Still another topic" topic.save - topicReloaded = Topic.find(topic.id) - topicReloaded.title = "A New Topic" - topicReloaded.send :write_attribute, 'does_not_exist', 'test' + topicReloaded = Topic.allocate + topicReloaded.init_with( + 'attributes' => topic.attributes.merge('does_not_exist' => 'test') + ) + topicReloaded.title = 'A New Topic' assert_nothing_raised { topicReloaded.save } end |