mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
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:
committed by
Jeremy Kemper
parent
2297eaed5b
commit
96deabace7
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user