aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord')
-rwxr-xr-xactiverecord/test/associations_test.rb4
-rw-r--r--activerecord/test/finder_test.rb7
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