X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/34173202861e94dee58ccd5b189983918813d870..0f9bca457448372de1d15dcd9ed4548c324ff14f:/apps/workbench/test/functional/actions_controller_test.rb diff --git a/apps/workbench/test/functional/actions_controller_test.rb b/apps/workbench/test/functional/actions_controller_test.rb index 965453841f..0e28b064e1 100644 --- a/apps/workbench/test/functional/actions_controller_test.rb +++ b/apps/workbench/test/functional/actions_controller_test.rb @@ -16,4 +16,30 @@ class ActionsControllerTest < ActionController::TestCase assert_equal true, found_email, 'Expected email after issue reported' end + test "combine files into new collection" do + post(:combine_selected_files_into_collection, { + selection: ['zzzzz-4zz18-znfnqtbbv4spc3w/foo', + 'zzzzz-4zz18-ehbhgtheo8909or/bar', + 'zzzzz-4zz18-y9vne9npefyxh8g/baz', + '1fd08fc162a5c6413070a8bd0bffc818+150'], + format: "json"}, + session_for(:active)) + + assert_response 302 # collection created and redirected to new collection page + + assert response.headers['Location'].include? '/collections/' + new_collection_uuid = response.headers['Location'].split('/')[-1] + + 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' + end + end