From fceecc54056fef8e91582422a7a805da0abc189d Mon Sep 17 00:00:00 2001 From: Brett Smith Date: Wed, 8 Apr 2015 16:00:57 -0400 Subject: [PATCH] 5614: Use assert_includes more in Workbench tests for better diagnostics. --- .../controllers/actions_controller_test.rb | 29 +++++++++---------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/apps/workbench/test/controllers/actions_controller_test.rb b/apps/workbench/test/controllers/actions_controller_test.rb index 8745d96792..e9063df0bd 100644 --- a/apps/workbench/test/controllers/actions_controller_test.rb +++ b/apps/workbench/test/controllers/actions_controller_test.rb @@ -33,13 +33,12 @@ class ActionsControllerTest < ActionController::TestCase use_token :active collection = Collection.select([:uuid, :manifest_text]).where(uuid: new_collection_uuid).first manifest_text = collection['manifest_text'] - assert manifest_text.include?('foo'), 'Not found foo in new collection manifest text' - assert manifest_text.include?('bar'), 'Not found bar in new collection manifest text' - assert manifest_text.include?('baz'), 'Not found baz in new collection manifest text' - assert manifest_text.include?('0:0:file1 0:0:file2 0:0:file3'), - 'Not found 0:0:file1 0:0:file2 0:0:file3 in new collection manifest text' - assert manifest_text.include?('dir1/subdir'), 'Not found dir1/subdir in new collection manifest text' - assert manifest_text.include?('dir2'), 'Not found dir2 in new collection manifest text' + assert_includes(manifest_text, "foo") + assert_includes(manifest_text, "bar") + assert_includes(manifest_text, "baz") + assert_includes(manifest_text, "0:0:file1 0:0:file2 0:0:file3") + assert_includes(manifest_text, "dir1/subdir") + assert_includes(manifest_text, "dir2") end test "combine files with repeated names into new collection" do @@ -61,15 +60,13 @@ class ActionsControllerTest < ActionController::TestCase use_token :active collection = Collection.select([:uuid, :manifest_text]).where(uuid: new_collection_uuid).first manifest_text = collection['manifest_text'] - assert manifest_text.include?('foo'), 'Not found foo in new collection manifest text' - assert manifest_text.include?('foo(1)'), 'Not found foo(1) in new collection manifest text' - assert manifest_text.include?('foo(2)'), 'Not found foo(2) in new collection manifest text' - assert manifest_text.include?('bar'), 'Not found bar in new collection manifest text' - assert manifest_text.include?('baz'), 'Not found baz in new collection manifest text' - assert manifest_text.include?('0:0:file1 0:0:file2 0:0:file3'), - 'Not found 0:0:file1 0:0:file2 0:0:file3 in new collection manifest text' - assert manifest_text.include?('dir1/subdir'), 'Not found dir1/subdir in new collection manifest text' - assert manifest_text.include?('dir2'), 'Not found dir2 in new collection manifest text' + assert_includes(manifest_text, "foo(1)") + assert_includes(manifest_text, "foo(2)") + assert_includes(manifest_text, "bar") + assert_includes(manifest_text, "baz") + assert_includes(manifest_text, "0:0:file1 0:0:file2 0:0:file3") + assert_includes(manifest_text, "dir1/subdir") + assert_includes(manifest_text, "dir2") end test "combine collections with repeated filenames in almost similar directories and expect files with proper suffixes" do -- 2.30.2