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>
This commit is contained in:
John Pignata
2009-12-05 11:57:13 -05:00
committed by Jeremy Kemper
parent 2297eaed5b
commit 96deabace7

View File

@@ -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