aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
diff options
context:
space:
mode:
authorCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-12-07 01:00:33 -0200
committerCarlos Antonio da Silva <carlosantoniodasilva@gmail.com>2012-12-07 01:08:38 -0200
commit55dec5a7da3e0bed51b1a37d152df9c7395e5a80 (patch)
tree2c2f3e3882be8adccebcab6cee9b016f1c343c1d /activerecord/test
parent6ba0f975d5d2867f80bcf8a809b1337c8f369383 (diff)
downloadrails-55dec5a7da3e0bed51b1a37d152df9c7395e5a80.tar.gz
rails-55dec5a7da3e0bed51b1a37d152df9c7395e5a80.tar.bz2
rails-55dec5a7da3e0bed51b1a37d152df9c7395e5a80.zip
Move where with blank conditions test to the correct where tests file
This test does not belong to has many associations test.
Diffstat (limited to 'activerecord/test')
-rw-r--r--activerecord/test/cases/associations/has_many_associations_test.rb6
-rw-r--r--activerecord/test/cases/relation/where_test.rb6
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 @@ class HasManyAssociationsTest < ActiveRecord::TestCase
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 @@ module ActiveRecord
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