X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/81ccd9264d0742ba1bf0b9dfbc31ff4f15929f3e..9c93e1f79c385269435299d90d00e1b36c09cf3c:/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..913f2b9728 100644 --- a/apps/workbench/test/controllers/disabled_api_test.rb +++ b/apps/workbench/test/controllers/disabled_api_test.rb @@ -1,7 +1,14 @@ +# Copyright (C) The Arvados Authors. All rights reserved. +# +# SPDX-License-Identifier: AGPL-3.0 + require 'test_helper' require 'helpers/share_object_helper' class DisabledApiTest < ActionController::TestCase + reset_api_fixtures :after_each_test, false + reset_api_fixtures :after_suite, false + test "dashboard recent processes when pipeline_instance index API is disabled" do @controller = ProjectsController.new @@ -13,7 +20,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 +52,7 @@ class DisabledApiTest < ActionController::TestCase end [ + :admin, :active, nil, ].each do |user| @@ -60,8 +78,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