diff options
author | kennyj <kennyj@gmail.com> | 2011-11-22 23:48:39 +0900 |
---|---|---|
committer | Carlos Antonio da Silva <carlosantoniodasilva@gmail.com> | 2012-03-04 11:42:20 -0300 |
commit | 9a2e164d733216b13dce7c766600b8b6ae9c9b12 (patch) | |
tree | 1373ac42c2729ecbe8e73eefa6ca24c907a123b0 /activerecord | |
parent | 4443b3647d9e350713eb20a720997ded62b6848e (diff) | |
download | rails-9a2e164d733216b13dce7c766600b8b6ae9c9b12.tar.gz rails-9a2e164d733216b13dce7c766600b8b6ae9c9b12.tar.bz2 rails-9a2e164d733216b13dce7c766600b8b6ae9c9b12.zip |
Added test case for new_record round trip with associations problem
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/base_test.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index 698c3d0cb1..190124b7aa 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -1920,6 +1920,20 @@ class BasicsTest < ActiveRecord::TestCase assert_equal 1, post.comments.length end + def test_marshalling_new_record_round_trip_with_associations + if ENV['TRAVIS'] && RUBY_VERSION == "1.8.7" + return skip("Marshalling tests disabled for Ruby 1.8.7 on Travis CI due to what appears " \ + "to be a Ruby bug.") + end + + post = Post.new + post.comments.build + + post = Marshal.load(Marshal.dump(post)) + + assert post.new_record?, "should be a new record" + end + def test_attribute_names assert_equal ["id", "type", "ruby_type", "firm_id", "firm_name", "name", "client_of", "rating", "account_id"], Company.attribute_names |