From 3cb7ab027f30d159d2034a4f6c03cb629adb4fe2 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 --- .../associations/has_many_associations_test.rb | 4 ++-- 1 files 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 3c490c1..05e7e38 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 @@ class HasManyAssociationsTest < ActiveRecord::TestCase 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 -- 1.6.5.2