diff options
author | Kenta <shirai.kenta@vareal.co.jp> | 2016-03-29 19:50:12 +0900 |
---|---|---|
committer | Kenta <shirai.kenta@vareal.co.jp> | 2016-03-30 00:00:26 +0900 |
commit | 78ea4c598547c46cdfcf71aa484782ac903a3040 (patch) | |
tree | 5067c1b30aca80cf889c1153ff4a17c0e8a7e410 /activerecord/test/cases/scoping | |
parent | 3c29836d1d94c0303f23768d4f2f5d3e8aea03ab (diff) | |
download | rails-78ea4c598547c46cdfcf71aa484782ac903a3040.tar.gz rails-78ea4c598547c46cdfcf71aa484782ac903a3040.tar.bz2 rails-78ea4c598547c46cdfcf71aa484782ac903a3040.zip |
Delegate some additional methods in querying.rb
Diffstat (limited to 'activerecord/test/cases/scoping')
-rw-r--r-- | activerecord/test/cases/scoping/named_scoping_test.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/activerecord/test/cases/scoping/named_scoping_test.rb b/activerecord/test/cases/scoping/named_scoping_test.rb index acba97bbb8..96c94eefa0 100644 --- a/activerecord/test/cases/scoping/named_scoping_test.rb +++ b/activerecord/test/cases/scoping/named_scoping_test.rb @@ -544,4 +544,24 @@ class NamedScopingTest < ActiveRecord::TestCase assert_equal 1, SpecialComment.where(body: 'go crazy').created.count end + def test_model_class_should_respond_to_empty + assert !Topic.empty? + Topic.delete_all + assert Topic.empty? + end + + def test_model_class_should_respond_to_none + assert !Topic.none? + Topic.delete_all + assert Topic.none? + end + + def test_model_class_should_respond_to_one + assert !Topic.one? + Topic.delete_all + assert !Topic.one? + Topic.create! + assert Topic.one? + end + end |