From 55dec5a7da3e0bed51b1a37d152df9c7395e5a80 Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Fri, 7 Dec 2012 01:00:33 -0200 Subject: [PATCH] Move where with blank conditions test to the correct where tests file This test does not belong to has many associations test. --- .../test/cases/associations/has_many_associations_test.rb | 6 ------ activerecord/test/cases/relation/where_test.rb | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/activerecord/test/cases/associations/has_many_associations_test.rb b/activerecord/test/cases/associations/has_many_associations_test.rb index d25aca760f..7e6c7d5862 100644 --- a/activerecord/test/cases/associations/has_many_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_associations_test.rb @@ -298,12 +298,6 @@ def test_finding_array_compatibility assert_equal 2, Firm.order(:id).find{|f| f.id > 0}.clients.length end - def test_find_with_blank_conditions - [[], {}, nil, ""].each do |blank| - assert_equal 2, Firm.all.merge!(:order => "id").first.clients.where(blank).to_a.size - end - end - def test_find_many_with_merged_options assert_equal 1, companies(:first_firm).limited_clients.size assert_equal 1, companies(:first_firm).limited_clients.to_a.size diff --git a/activerecord/test/cases/relation/where_test.rb b/activerecord/test/cases/relation/where_test.rb index 9c0b139dbf..297e865308 100644 --- a/activerecord/test/cases/relation/where_test.rb +++ b/activerecord/test/cases/relation/where_test.rb @@ -85,5 +85,11 @@ def test_where_with_table_name_and_empty_hash def test_where_with_empty_hash_and_no_foreign_key assert_equal 0, Edge.where(:sink => {}).count end + + def test_where_with_blank_conditions + [[], {}, nil, ""].each do |blank| + assert_equal 4, Edge.where(blank).order("sink_id").to_a.size + end + end end end -- GitLab