aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorJohn Pignata <john.pignata@gmail.com>2009-12-05 11:57:13 -0500
committerJeremy Kemper <jeremy@bitsweat.net>2009-12-11 15:15:12 -0600
commit96deabace71d5cb3ee12c7b99e459db5e2acb1a6 (patch)
treead29eacbc435a939a60d109b9231fb1a33b5e0c1 /activerecord/test/cases
parent2297eaed5b195ea42b99d062ad45f87dde9d3c60 (diff)
downloadrails-96deabace71d5cb3ee12c7b99e459db5e2acb1a6.tar.gz
rails-96deabace71d5cb3ee12c7b99e459db5e2acb1a6.tar.bz2
rails-96deabace71d5cb3ee12c7b99e459db5e2acb1a6.zip
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 <jeremy@bitsweat.net>
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/associations/has_many_associations_test.rb4
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 3c490c1eeb..05e7e380a8 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