diff options
author | Matthew Draper <matthew@trebex.net> | 2014-07-05 00:15:04 +0930 |
---|---|---|
committer | Matthew Draper <matthew@trebex.net> | 2014-07-05 00:21:24 +0930 |
commit | de03c2977894787af7c837eabc50d0387bf4f261 (patch) | |
tree | 977ef7b190f3e9e9cfaac4bcb518e0651fe7e474 /activerecord/test | |
parent | a8e1538b6032be16c499a7049c2eaa1eeb2265ac (diff) | |
download | rails-de03c2977894787af7c837eabc50d0387bf4f261.tar.gz rails-de03c2977894787af7c837eabc50d0387bf4f261.tar.bz2 rails-de03c2977894787af7c837eabc50d0387bf4f261.zip |
After find-via-reload, the record is not new
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/persistence_test.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/activerecord/test/cases/persistence_test.rb b/activerecord/test/cases/persistence_test.rb index 1192ecd6b4..9b762fc0d5 100644 --- a/activerecord/test/cases/persistence_test.rb +++ b/activerecord/test/cases/persistence_test.rb @@ -865,4 +865,16 @@ class PersistenceTest < ActiveRecord::TestCase assert_equal 1, post[:wibble] assert_nil post.reload[:wibble] end + + def test_find_via_reload + post = Post.new + + assert post.new_record? + + post.id = 1 + post.reload + + assert_equal "Welcome to the weblog", post.title + assert_not post.new_record? + end end |