X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/aa12c56d26cb72824ddd2399e17e846cd9d9b483..0e12d049716003b08c4fc881343ebf14c3522b99:/apps/workbench/test/controllers/trash_items_controller_test.rb diff --git a/apps/workbench/test/controllers/trash_items_controller_test.rb b/apps/workbench/test/controllers/trash_items_controller_test.rb index d5b0d90478..40a017b3ed 100644 --- a/apps/workbench/test/controllers/trash_items_controller_test.rb +++ b/apps/workbench/test/controllers/trash_items_controller_test.rb @@ -1,28 +1,18 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + require 'test_helper' class TrashItemsControllerTest < ActionController::TestCase - reset_api_fixtures :after_each_test, false - reset_api_fixtures :after_suite, true - - [ - :active, - :admin, - ].each do |user| - test "trash index page as #{user}" do - get :index, {partial: :trash_rows, format: :json}, session_for(user) - assert_response :success - - items = [] - @response.body.scan(/tr\ data-object-uuid=\\"(.*?)\\"/).each do |uuid,| - items << uuid - end + test "untrash collection with same name as another collection" do + collection = api_fixture('collections')['trashed_collection_to_test_name_conflict_on_untrash'] + items = [collection['uuid']] + post :untrash_items, { + selection: items, + format: :js + }, session_for(:active) - assert_includes(items, api_fixture('collections')['unique_expired_collection']['uuid']) - if user == :admin - assert_includes(items, api_fixture('collections')['unique_expired_collection2']['uuid']) - else - assert_not_includes(items, api_fixture('collections')['unique_expired_collection2']['uuid']) - end - end + assert_response :success end end