From 96deabace71d5cb3ee12c7b99e459db5e2acb1a6 Mon Sep 17 00:00:00 2001 From: John Pignata Date: Sat, 5 Dec 2009 11:57:13 -0500 Subject: [PATCH] Fix postgresql AR test failure Due to the ordering of the returning result set, the test fails under the postgresql adapter. Order results by id prior to checking the first item [#3542 state:committed] Signed-off-by: Jeremy Kemper --- .../test/cases/associations/has_many_associations_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/activerecord/test/cases/associations/has_many_associations_test.rb b/activerecord/test/cases/associations/has_many_associations_test.rb index 3c490c1eebb54..05e7e380a8e71 100644 --- a/activerecord/test/cases/associations/has_many_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_associations_test.rb @@ -1180,11 +1180,11 @@ def test_creating_using_primary_key end def test_normal_method_call_in_association_proxy - assert_equal 'Welcome to the weblog', Comment.all.map { |comment| comment.post }.first.title + assert_equal 'Welcome to the weblog', Comment.all.map { |comment| comment.post }.sort_by(&:id).first.title end def test_instance_eval_in_association_proxy - assert_equal 'Welcome to the weblog', Comment.all.map { |comment| comment.post }.first.instance_eval{title} + assert_equal 'Welcome to the weblog', Comment.all.map { |comment| comment.post }.sort_by(&:id).first.instance_eval{title} end end