From 82c39e1a0b5114e2d89a80883a41090567a83196 Mon Sep 17 00:00:00 2001 From: Daniel Colson Date: Thu, 25 Jan 2018 18:16:57 -0500 Subject: Use assert_empty and assert_not_empty --- .../associations/has_many_through_associations_test.rb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'activerecord/test/cases/associations/has_many_through_associations_test.rb') diff --git a/activerecord/test/cases/associations/has_many_through_associations_test.rb b/activerecord/test/cases/associations/has_many_through_associations_test.rb index 37d506cec1..25118b26f5 100644 --- a/activerecord/test/cases/associations/has_many_through_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_through_associations_test.rb @@ -353,10 +353,10 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase end assert_queries(1) do - assert_predicate posts(:welcome).people, :empty? + assert_empty posts(:welcome).people end - assert_predicate posts(:welcome).reload.people.reload, :empty? + assert_empty posts(:welcome).reload.people.reload end def test_destroy_association @@ -366,8 +366,8 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase end end - assert_predicate posts(:welcome).reload.people, :empty? - assert_predicate posts(:welcome).people.reload, :empty? + assert_empty posts(:welcome).reload.people + assert_empty posts(:welcome).people.reload end def test_destroy_all @@ -377,8 +377,8 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase end end - assert_predicate posts(:welcome).reload.people, :empty? - assert_predicate posts(:welcome).people.reload, :empty? + assert_empty posts(:welcome).reload.people + assert_empty posts(:welcome).people.reload end def test_should_raise_exception_for_destroying_mismatching_records @@ -685,10 +685,10 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase end assert_queries(0) do - assert_predicate posts(:welcome).people, :empty? + assert_empty posts(:welcome).people end - assert_predicate posts(:welcome).reload.people.reload, :empty? + assert_empty posts(:welcome).reload.people.reload end def test_association_callback_ordering @@ -862,7 +862,7 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase category = author.named_categories.create(name: "Primary") author.named_categories.delete(category) assert !Categorization.exists?(author_id: author.id, named_category_name: category.name) - assert_predicate author.named_categories.reload, :empty? + assert_empty author.named_categories.reload end def test_collection_singular_ids_getter_with_string_primary_keys -- cgit v1.2.3