Permalink
Browse files

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>
  • Loading branch information...
1 parent b9f3523 commit 1d9468b44e29e50170a5babd24c0fb67b040792f John Pignata committed with jeremy Dec 5, 2009
Showing with 2 additions and 2 deletions.
  1. +2 −2 activerecord/test/cases/associations/has_many_associations_test.rb
@@ -1132,11 +1132,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

0 comments on commit 1d9468b

Please sign in to comment.