X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/6f461f4d0a996da85140982846a5d5c10ccfaae4..921e5feb0deff2f1b420e867faf79a4ecd293350:/apps/workbench/test/controllers/disabled_api_test.rb diff --git a/apps/workbench/test/controllers/disabled_api_test.rb b/apps/workbench/test/controllers/disabled_api_test.rb index 1154e4d5e2..90cb23b90d 100644 --- a/apps/workbench/test/controllers/disabled_api_test.rb +++ b/apps/workbench/test/controllers/disabled_api_test.rb @@ -1,3 +1,7 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + require 'test_helper' require 'helpers/share_object_helper' @@ -13,7 +17,17 @@ class DisabledApiTest < ActionController::TestCase assert_includes @response.body, "zzzzz-xvhdp-cr4runningcntnr" # expect crs assert_not_includes @response.body, "zzzzz-d1hrv-" # expect no pipelines assert_includes @response.body, "Run a process" - assert_not_includes @response.body, "Run a pipeline" + end + + test "dashboard compute node status not shown when pipeline_instance index API is disabled" do + @controller = ProjectsController.new + + dd = ArvadosApiClient.new_or_current.discovery.deep_dup + dd[:resources][:pipeline_instances][:methods].delete(:index) + ArvadosApiClient.any_instance.stubs(:discovery).returns(dd) + + get :index, {}, session_for(:active) + assert_not_includes @response.body, "compute-node-summary-pane" end [ @@ -35,6 +49,7 @@ class DisabledApiTest < ActionController::TestCase end [ + :admin, :active, nil, ].each do |user| @@ -60,8 +75,7 @@ class DisabledApiTest < ActionController::TestCase assert_includes resp, "href=\"#Pipelines_and_processes\"" assert_includes resp, "href=\"#Workflows\"" assert_not_includes resp, "href=\"#Pipeline_templates\"" - assert_includes @response.body, "Run a process" - assert_not_includes @response.body, "Run a pipeline" + assert_includes @response.body, "Run a process" if user == :admin end end end