Browse files

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
  • Loading branch information...
1 parent 68b19ea commit dedb9c8483fc916bb5fd40d7e8a35af5f8e7a90b @jeremy jeremy committed Jun 12, 2005
Showing with 6 additions and 5 deletions.
  1. +2 −2 activerecord/test/associations_test.rb
  2. +4 −3 activerecord/test/finder_test.rb
View
4 activerecord/test/associations_test.rb
@@ -734,9 +734,9 @@ def test_has_and_belongs_to_many
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
View
7 activerecord/test/finder_test.rb
@@ -278,10 +278,11 @@ def test_find_all_with_limit_and_offset
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

0 comments on commit dedb9c8

Please sign in to comment.