Skip to content
This repository
Browse code

Move where with blank conditions test to the correct where tests file

This test does not belong to has many associations test.
  • Loading branch information...
commit 55dec5a7da3e0bed51b1a37d152df9c7395e5a80 1 parent 6ba0f97
Carlos Antonio da Silva authored December 07, 2012
6  activerecord/test/cases/associations/has_many_associations_test.rb
@@ -298,12 +298,6 @@ def test_finding_array_compatibility
298 298
     assert_equal 2, Firm.order(:id).find{|f| f.id > 0}.clients.length
299 299
   end
300 300
 
301  
-  def test_find_with_blank_conditions
302  
-    [[], {}, nil, ""].each do |blank|
303  
-      assert_equal 2, Firm.all.merge!(:order => "id").first.clients.where(blank).to_a.size
304  
-    end
305  
-  end
306  
-
307 301
   def test_find_many_with_merged_options
308 302
     assert_equal 1, companies(:first_firm).limited_clients.size
309 303
     assert_equal 1, companies(:first_firm).limited_clients.to_a.size
6  activerecord/test/cases/relation/where_test.rb
@@ -85,5 +85,11 @@ def test_where_with_table_name_and_empty_hash
85 85
     def test_where_with_empty_hash_and_no_foreign_key
86 86
       assert_equal 0, Edge.where(:sink => {}).count
87 87
     end
  88
+
  89
+    def test_where_with_blank_conditions
  90
+      [[], {}, nil, ""].each do |blank|
  91
+        assert_equal 4, Edge.where(blank).order("sink_id").to_a.size
  92
+      end
  93
+    end
88 94
   end
89 95
 end

0 notes on commit 55dec5a

Please sign in to comment.
Something went wrong with that request. Please try again.