diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2005-06-12 02:27:19 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2005-06-12 02:27:19 +0000 |
commit | dedb9c8483fc916bb5fd40d7e8a35af5f8e7a90b (patch) | |
tree | 60f29f83b43e55b683bf852c197a0a8b3ab8ded4 /activerecord | |
parent | 68b19ea7f3255fc54c4194c394d5ed8f997ba75f (diff) | |
download | rails-dedb9c8483fc916bb5fd40d7e8a35af5f8e7a90b.tar.gz rails-dedb9c8483fc916bb5fd40d7e8a35af5f8e7a90b.tar.bz2 rails-dedb9c8483fc916bb5fd40d7e8a35af5f8e7a90b.zip |
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
Diffstat (limited to 'activerecord')
-rwxr-xr-x | activerecord/test/associations_test.rb | 4 | ||||
-rw-r--r-- | 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 |