X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/df9e166a5ffc4aa79658bec1a5d552a3b413f0d8..2bef371e8429430942193fff02599ec51c081e70:/apps/workbench/test/controllers/search_controller_test.rb diff --git a/apps/workbench/test/controllers/search_controller_test.rb b/apps/workbench/test/controllers/search_controller_test.rb index a09d966a18..c57d70533e 100644 --- a/apps/workbench/test/controllers/search_controller_test.rb +++ b/apps/workbench/test/controllers/search_controller_test.rb @@ -1,3 +1,7 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + require 'test_helper' class SearchControllerTest < ActionController::TestCase @@ -39,4 +43,27 @@ class SearchControllerTest < ActionController::TestCase assert_empty(json_response['content'], 'search results for empty project should be empty') end + + test 'search results for aproject and verify recursive contents' do + xhr :get, :choose, { + format: :json, + partial: true, + project_uuid: api_fixture('groups')['aproject']['uuid'], + }, session_for(:active) + assert_response :success + assert_not_empty(json_response['content'], + 'search results for aproject should not be empty') + items = [] + json_response['content'].scan /]+>/ do |div_tag| + div_tag.scan(/\ data-object-uuid=\"(.*?)\"/).each do |uuid,| + items << uuid + end + end + + assert_includes(items, api_fixture('collections')['collection_to_move_around_in_aproject']['uuid']) + assert_includes(items, api_fixture('groups')['asubproject']['uuid']) + assert_includes(items, api_fixture('collections')['baz_collection_name_in_asubproject']['uuid']) + assert_includes(items, + api_fixture('groups')['subproject_in_asubproject_with_same_name_as_one_in_active_user_home']['uuid']) + end end