Permalink
Browse files

No need to cache table metadata in advance now that #6683 was merged.

  • Loading branch information...
1 parent bd8c0b8 commit 65d584c35b97c57079cb788e375685dd5e2e787c @rafaelfranca rafaelfranca committed Jun 11, 2012
@@ -29,11 +29,6 @@ class EagerAssociationTest < ActiveRecord::TestCase
:owners, :pets, :author_favorites, :jobs, :references, :subscribers, :subscriptions, :books,
:developers, :projects, :developers_projects, :members, :memberships, :clubs, :sponsors
- def setup
- # preheat table existence caches
- Comment.find_by_id(1)
- end
-
def test_eager_with_has_one_through_join_model_with_conditions_on_the_through
member = Member.scoped(:includes => :favourite_club).find(members(:some_other_guy).id)
assert_nil member.favourite_club
@@ -962,10 +957,6 @@ def test_eager_loading_with_order_on_joined_table_preloads
end
def test_eager_loading_with_conditions_on_joined_table_preloads
- # cache metadata in advance to avoid extra sql statements executed while testing
- Tagging.first
- Tag.first
-
posts = assert_queries(2) do
Post.scoped(:select => 'distinct posts.*', :includes => :author, :joins => [:comments], :where => "comments.body like 'Thank you%'", :order => 'posts.id').all
end
@@ -987,7 +978,6 @@ def test_eager_loading_with_conditions_on_joined_table_preloads
Post.scoped(:includes => :author, :joins => {:taggings => {:tag => :taggings}}, :where => "taggings_tags.super_tag_id=2", :order => 'posts.id').all
end
assert_equal posts(:welcome, :thinking), posts
-
end
def test_eager_loading_with_conditions_on_string_joined_table_preloads
@@ -1002,7 +992,6 @@ def test_eager_loading_with_conditions_on_string_joined_table_preloads
end
assert_equal [posts(:welcome)], posts
assert_equal authors(:david), assert_no_queries { posts[0].author}
-
end
def test_eager_loading_with_select_on_joined_table_preloads
@@ -1353,15 +1353,11 @@ def test_custom_primary_key_on_new_record_should_fetch_with_query
author = Author.new(:name => "David")
assert !author.essays.loaded?
- # cache metadata in advance to avoid extra sql statements executed while testing
- Essay.first
-
assert_queries 1 do
assert_equal 1, author.essays.size
end
assert_equal author.essays, Essay.where(writer_id: "David")
-
end
def test_has_many_custom_primary_key
@@ -1441,7 +1437,6 @@ def test_joins_with_namespaced_model_should_use_correct_type
:group => "#{Namespaced::Firm.table_name}.id"
).find firm.id
assert_equal 1, stats.num_clients.to_i
-
ensure
ActiveRecord::Base.store_full_sti_class = old
end

0 comments on commit 65d584c

Please sign in to comment.