From cd6d6fcb239f08ce039d2f70960014477f4e550b Mon Sep 17 00:00:00 2001 From: Emilio Tagua Date: Tue, 21 Sep 2010 10:54:54 -0300 Subject: Change test models. --- activerecord/test/cases/identity_map_test.rb | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/activerecord/test/cases/identity_map_test.rb b/activerecord/test/cases/identity_map_test.rb index 5edbd34be2..f9eef250d3 100644 --- a/activerecord/test/cases/identity_map_test.rb +++ b/activerecord/test/cases/identity_map_test.rb @@ -126,20 +126,20 @@ class IdentityMapTest < ActiveRecord::TestCase # end def test_changing_associations - t1 = Topic.create("title" => "t1") - t2 = Topic.create("title" => "t2") - r1 = Reply.new("title" => "r1", "content" => "r1") + post1 = Post.create("title" => "One post", "body" => "Posting...") + post2 = Post.create("title" => "Another post", "body" => "Posting... Again...") + comment = Comment.new("body" => "comment") - r1.topic = t1 - assert r1.save + comment.post = post1 + assert comment.save - assert_same(t1.replies.first, r1) + assert_same(post1.comments.first, comment) - r1.topic = t2 - assert r1.save + comment.post = post2 + assert comment.save - assert_same(t2.replies.first, r1) - assert_equal(0, t1.replies.size) + assert_same(post2.comments.first, comment) + assert_equal(0, post1.comments.size) end def test_im_with_polymorphic_has_many_going_through_join_model_with_custom_select_and_joins -- cgit v1.2.3