Permalink
Browse files

Added test case for new_record round trip with associations problem

  • Loading branch information...
1 parent 4443b36 commit 9a2e164d733216b13dce7c766600b8b6ae9c9b12 @kennyj kennyj committed with carlosantoniodasilva Nov 22, 2011
Showing with 14 additions and 0 deletions.
  1. +14 −0 activerecord/test/cases/base_test.rb
@@ -1920,6 +1920,20 @@ def test_marshalling_with_associations
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

0 comments on commit 9a2e164

Please sign in to comment.