diff options
author | utilum <oz@utilum.com> | 2018-04-22 13:31:43 +0200 |
---|---|---|
committer | utilum <oz@utilum.com> | 2018-04-26 08:02:08 +0200 |
commit | e4e25cc8dc76f641a304251ba37e1db99713e584 (patch) | |
tree | 9984a9ba7b4f594e52f39e9e971025f450e982c0 /activerecord/test/cases/associations/has_many_associations_test.rb | |
parent | 1a1650a012f03b62f0b19a58d3cdfa536cf9c4b7 (diff) | |
download | rails-e4e25cc8dc76f641a304251ba37e1db99713e584.tar.gz rails-e4e25cc8dc76f641a304251ba37e1db99713e584.tar.bz2 rails-e4e25cc8dc76f641a304251ba37e1db99713e584.zip |
assert_not_called
Diffstat (limited to 'activerecord/test/cases/associations/has_many_associations_test.rb')
-rw-r--r-- | activerecord/test/cases/associations/has_many_associations_test.rb | 15 |
1 files changed, 9 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 33fe5ccabc..d1bf98a8e3 100644 --- a/activerecord/test/cases/associations/has_many_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_associations_test.rb @@ -1986,8 +1986,9 @@ class HasManyAssociationsTest < ActiveRecord::TestCase def test_calling_many_should_defer_to_collection_if_using_a_block firm = companies(:first_firm) assert_queries(1) do - firm.clients.expects(:size).never - firm.clients.many? { true } + assert_not_called(firm.clients, :size) do + firm.clients.many? { true } + end end assert_predicate firm.clients, :loaded? end @@ -2025,8 +2026,9 @@ class HasManyAssociationsTest < ActiveRecord::TestCase def test_calling_none_should_defer_to_collection_if_using_a_block firm = companies(:first_firm) assert_queries(1) do - firm.clients.expects(:size).never - firm.clients.none? { true } + assert_not_called(firm.clients, :size) do + firm.clients.none? { true } + end end assert_predicate firm.clients, :loaded? end @@ -2060,8 +2062,9 @@ class HasManyAssociationsTest < ActiveRecord::TestCase def test_calling_one_should_defer_to_collection_if_using_a_block firm = companies(:first_firm) assert_queries(1) do - firm.clients.expects(:size).never - firm.clients.one? { true } + assert_not_called(firm.clients, :size) do + firm.clients.one? { true } + end end assert_predicate firm.clients, :loaded? end |