aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/relations_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/cases/relations_test.rb')
-rw-r--r--activerecord/test/cases/relations_test.rb17
1 files changed, 10 insertions, 7 deletions
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb
index 195889f1df..d34c9b4895 100644
--- a/activerecord/test/cases/relations_test.rb
+++ b/activerecord/test/cases/relations_test.rb
@@ -68,10 +68,12 @@ class RelationTest < ActiveRecord::TestCase
assert topics.loaded?
- topics.reload
- assert ! topics.loaded?
+ original_size = topics.to_a.size
+ Topic.create! :title => 'fake'
- assert_queries(1) { topics.to_a }
+ assert_queries(1) { topics.reload }
+ assert_equal original_size + 1, topics.size
+ assert topics.loaded?
end
def test_finding_with_conditions
@@ -337,6 +339,11 @@ class RelationTest < ActiveRecord::TestCase
assert_raises(ActiveRecord::RecordNotFound) { authors.find(['42', 43]) }
end
+ def test_find_in_empty_array
+ authors = Author.scoped.where(:id => [])
+ assert authors.all.blank?
+ end
+
def test_exists
davids = Author.where(:name => 'David')
assert davids.exists?
@@ -418,10 +425,6 @@ class RelationTest < ActiveRecord::TestCase
end
end
- def test_invalid_merge
- assert_raises(ArgumentError) { Post.scoped & Developer.scoped }
- end
-
def test_count
posts = Post.scoped