aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/resources_test.rb
diff options
context:
space:
mode:
authorMichael Grosser <michael@grosser.it>2016-09-16 09:44:05 -0700
committerMichael Grosser <michael@grosser.it>2016-09-16 12:03:37 -0700
commita9aed2ac94d2e0d1a233a3c193985ae78d7e79e9 (patch)
treed550056dbf4a70b5c7562f1a715045c5a3968b0c /actionpack/test/controller/resources_test.rb
parentf62451a50b2c9119adce7acc53ce3dfffc4d41d5 (diff)
downloadrails-a9aed2ac94d2e0d1a233a3c193985ae78d7e79e9.tar.gz
rails-a9aed2ac94d2e0d1a233a3c193985ae78d7e79e9.tar.bz2
rails-a9aed2ac94d2e0d1a233a3c193985ae78d7e79e9.zip
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
Diffstat (limited to 'actionpack/test/controller/resources_test.rb')
-rw-r--r--actionpack/test/controller/resources_test.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/actionpack/test/controller/resources_test.rb b/actionpack/test/controller/resources_test.rb
index 29471939d0..b572e7e8d5 100644
--- a/actionpack/test/controller/resources_test.rb
+++ b/actionpack/test/controller/resources_test.rb
@@ -1313,7 +1313,7 @@ class ResourcesTest < ActionController::TestCase
def assert_resource_methods(expected, resource, action_method, method)
assert_equal expected.length, resource.send("#{action_method}_methods")[method].size, "#{resource.send("#{action_method}_methods")[method].inspect}"
expected.each do |action|
- assert resource.send("#{action_method}_methods")[method].include?(action),
+ assert_includes resource.send("#{action_method}_methods")[method], action,
"#{method} not in #{action_method} methods: #{resource.send("#{action_method}_methods")[method].inspect}"
end
end