aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases
diff options
context:
space:
mode:
authorNeeraj Singh <neerajdotname@gmail.com>2013-03-23 14:57:07 -0400
committerNeeraj Singh <neerajdotname@gmail.com>2013-03-23 16:01:26 -0400
commit36a45230dac4546b71b145681cf553a5a4f9eccb (patch)
treef6cd759d369b4c9ee40ee189e9cd1fb134a72b3c /activerecord/test/cases
parenta1a2951518b2a4249101ebc87694800a345512f7 (diff)
downloadrails-36a45230dac4546b71b145681cf553a5a4f9eccb.tar.gz
rails-36a45230dac4546b71b145681cf553a5a4f9eccb.tar.bz2
rails-36a45230dac4546b71b145681cf553a5a4f9eccb.zip
enhance unscoped tests
Make it obvious that using unscoped with another scope without the block works
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r--activerecord/test/cases/relation_scoping_test.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activerecord/test/cases/relation_scoping_test.rb b/activerecord/test/cases/relation_scoping_test.rb
index 239004a223..6cd89b6227 100644
--- a/activerecord/test/cases/relation_scoping_test.rb
+++ b/activerecord/test/cases/relation_scoping_test.rb
@@ -634,7 +634,11 @@ class DefaultScopingTest < ActiveRecord::TestCase
assert_equal [DeveloperCalledJamis.find(developers(:poor_jamis).id)], DeveloperCalledJamis.poor
assert DeveloperCalledJamis.unscoped.poor.include?(developers(:david).becomes(DeveloperCalledJamis))
+
+ assert_equal 11, DeveloperCalledJamis.unscoped.length
+ assert_equal 1, DeveloperCalledJamis.poor.length
assert_equal 10, DeveloperCalledJamis.unscoped.poor.length
+ assert_equal 10, DeveloperCalledJamis.unscoped { DeveloperCalledJamis.poor }.length
end
def test_default_scope_select_ignored_by_aggregations