mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Don't expect fixtures to be returned in the order they were inserted.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1402 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
cd033c63c2
commit
68b19ea7f3
2 changed files with 4 additions and 3 deletions
|
@ -44,8 +44,9 @@ class EagerAssociationTest < Test::Unit::TestCase
|
||||||
|
|
||||||
def test_eager_association_loading_with_belongs_to
|
def test_eager_association_loading_with_belongs_to
|
||||||
comments = Comment.find(:all, :include => :post)
|
comments = Comment.find(:all, :include => :post)
|
||||||
assert_equal posts(:welcome).title, comments.first.post.title
|
titles = comments.map { |c| c.post.title }
|
||||||
assert_equal posts(:thinking).title, comments.last.post.title
|
assert titles.include?(posts(:welcome).title)
|
||||||
|
assert titles.include?(posts(:thinking).title)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_eager_association_loading_with_habtm
|
def test_eager_association_loading_with_habtm
|
||||||
|
|
|
@ -181,7 +181,7 @@ class DeprecatedAssociationsTest < Test::Unit::TestCase
|
||||||
active_record = Project.find(1)
|
active_record = Project.find(1)
|
||||||
assert active_record.has_developers?
|
assert active_record.has_developers?
|
||||||
assert_equal 2, active_record.developers_count
|
assert_equal 2, active_record.developers_count
|
||||||
assert_equal david.name, active_record.developers.first.name
|
assert active_record.developers.include?(david)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_has_and_belongs_to_many_removing
|
def test_has_and_belongs_to_many_removing
|
||||||
|
|
Loading…
Reference in a new issue