diff options
author | Daniel Colson <danieljamescolson@gmail.com> | 2018-01-25 18:16:57 -0500 |
---|---|---|
committer | Daniel Colson <danieljamescolson@gmail.com> | 2018-01-25 23:32:59 -0500 |
commit | 82c39e1a0b5114e2d89a80883a41090567a83196 (patch) | |
tree | 476f620e0224130ca3dca3ed4e9b5a58fb0d5da9 /activerecord/test/cases/associations/has_many_through_associations_test.rb | |
parent | 94333a4c31bd10c1f358c538a167e6a4589bae2d (diff) | |
download | rails-82c39e1a0b5114e2d89a80883a41090567a83196.tar.gz rails-82c39e1a0b5114e2d89a80883a41090567a83196.tar.bz2 rails-82c39e1a0b5114e2d89a80883a41090567a83196.zip |
Use assert_empty and assert_not_empty
Diffstat (limited to 'activerecord/test/cases/associations/has_many_through_associations_test.rb')
-rw-r--r-- | activerecord/test/cases/associations/has_many_through_associations_test.rb | 18 |
1 files changed, 9 insertions, 9 deletions
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 |