aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorEmilio Tagua <miloops@gmail.com>2010-09-21 10:54:54 -0300
committerEmilio Tagua <miloops@gmail.com>2010-11-19 19:08:10 -0300
commitcd6d6fcb239f08ce039d2f70960014477f4e550b (patch)
tree6ad0d45f5c21bdc6f062d810f8b9042251c59785 /activerecord
parent0f169493a2614328986f6f4a8c2c7a1943223747 (diff)
downloadrails-cd6d6fcb239f08ce039d2f70960014477f4e550b.tar.gz
rails-cd6d6fcb239f08ce039d2f70960014477f4e550b.tar.bz2
rails-cd6d6fcb239f08ce039d2f70960014477f4e550b.zip
Change test models.
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/test/cases/identity_map_test.rb20
1 files 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