From a9aed2ac94d2e0d1a233a3c193985ae78d7e79e9 Mon Sep 17 00:00:00 2001 From: Michael Grosser Date: Fri, 16 Sep 2016 09:44:05 -0700 Subject: improve error message when include assertions fail assert [1, 3].includes?(2) fails with unhelpful "Asserting failed" message assert_includes [1, 3], 2 fails with "Expected [1, 3] to include 2" which makes it easier to debug and more obvious what went wrong --- activerecord/test/cases/associations/cascaded_eager_loading_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activerecord/test/cases/associations/cascaded_eager_loading_test.rb') diff --git a/activerecord/test/cases/associations/cascaded_eager_loading_test.rb b/activerecord/test/cases/associations/cascaded_eager_loading_test.rb index 9ae1558dc9..e87431bf32 100644 --- a/activerecord/test/cases/associations/cascaded_eager_loading_test.rb +++ b/activerecord/test/cases/associations/cascaded_eager_loading_test.rb @@ -134,8 +134,8 @@ class CascadedEagerLoadingTest < ActiveRecord::TestCase def test_eager_association_loading_with_belongs_to_sti replies = Reply.all.merge!(includes: :topic, order: "topics.id").to_a - assert replies.include?(topics(:second)) - assert !replies.include?(topics(:first)) + assert_includes replies, topics(:second) + assert_not_includes replies, topics(:first) assert_equal topics(:first), assert_no_queries { replies.first.topic } end -- cgit v1.2.3