Merge branch '19954-permission-dedup-doc'
[arvados.git] / apps / workbench / test / controllers / search_controller_test.rb
index 9b7192f7831b143b54dc2bc3c76de4fc90aea3f6..e620fbd8617c8fd135a1d19d08706e90e2f4406d 100644 (file)
@@ -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
@@ -9,43 +13,43 @@ class SearchControllerTest < ActionController::TestCase
   include Rails.application.routes.url_helpers
 
   test 'Get search dialog' do
-    xhr :get, :choose, {
+    get :choose, params: {
       format: :js,
       title: 'Search',
       action_name: 'Show',
       action_href: url_for(host: 'localhost', controller: :actions, action: :show),
       action_data: {}.to_json,
-    }, session_for(:active)
+    }, session: session_for(:active), xhr: true
     assert_response :success
   end
 
   test 'Get search results for all projects' do
-    xhr :get, :choose, {
+    get :choose, params: {
       format: :json,
       partial: true,
-    }, session_for(:active)
+    }, session: session_for(:active), xhr: true
     assert_response :success
     assert_not_empty(json_response['content'],
                      'search results for all projects should not be empty')
   end
 
   test 'Get search results for empty project' do
-    xhr :get, :choose, {
+    get :choose, params: {
       format: :json,
       partial: true,
       project_uuid: api_fixture('groups')['empty_project']['uuid'],
-    }, session_for(:active)
+    }, session: session_for(:active), xhr: true
     assert_response :success
     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, {
+    get :choose, params: {
       format: :json,
       partial: true,
       project_uuid: api_fixture('groups')['aproject']['uuid'],
-    }, session_for(:active)
+    }, session: session_for(:active), xhr: true
     assert_response :success
     assert_not_empty(json_response['content'],
                  'search results for aproject should not be empty')