From dedb9c8483fc916bb5fd40d7e8a35af5f8e7a90b Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sun, 12 Jun 2005 02:27:19 +0000 Subject: [PATCH] Don't expect fixtures to be returned in the order they were inserted. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1403 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/test/associations_test.rb | 4 ++-- activerecord/test/finder_test.rb | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/activerecord/test/associations_test.rb b/activerecord/test/associations_test.rb index 4cf4868ef7..05daf9b9c1 100755 --- a/activerecord/test/associations_test.rb +++ b/activerecord/test/associations_test.rb @@ -734,9 +734,9 @@ class HasAndBelongsToManyAssociationsTest < Test::Unit::TestCase active_record = Project.find(1) assert !active_record.developers.empty? assert_equal 2, active_record.developers.size - assert_equal david.name, active_record.developers.first.name + assert active_record.developers.include?(david) end - + def test_adding_single jamis = Developer.find(2) jamis.projects.reload # causing the collection to load diff --git a/activerecord/test/finder_test.rb b/activerecord/test/finder_test.rb index e95704e142..7a2a0ab0a1 100644 --- a/activerecord/test/finder_test.rb +++ b/activerecord/test/finder_test.rb @@ -278,10 +278,11 @@ class FinderTest < Test::Unit::TestCase def test_find_all_with_join developers_on_project_one = Developer.find :all, :joins => 'developers_projects', :conditions => 'id=developer_id AND project_id=1' - + assert_equal 2, developers_on_project_one.length - assert_equal 'David', developers_on_project_one.first.name - assert_equal 'Jamis', developers_on_project_one.last.name + developer_names = developers_on_project_one.map { |d| d.name } + assert developer_names.include?('David') + assert developer_names.include?('Jamis') end protected