From 78ea4c598547c46cdfcf71aa484782ac903a3040 Mon Sep 17 00:00:00 2001 From: Kenta Date: Tue, 29 Mar 2016 19:50:12 +0900 Subject: Delegate some additional methods in querying.rb --- .../test/cases/scoping/named_scoping_test.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'activerecord/test/cases/scoping') 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 -- cgit v1.2.3