7475: Merge branch 'master' into 7475-nodemgr-unsatisfiable-job-comms
[arvados.git] / apps / workbench / test / unit / disabled_api_test.rb
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: AGPL-3.0
4
5 require 'test_helper'
6
7 class DisabledApiTest < ActiveSupport::TestCase
8   test 'Job.creatable? reflects whether jobs.create API is enabled' do
9     use_token(:active) do
10       assert(Job.creatable?)
11     end
12     dd = ArvadosApiClient.new_or_current.discovery.deep_dup
13     dd[:resources][:jobs][:methods].delete(:create)
14     ArvadosApiClient.any_instance.stubs(:discovery).returns(dd)
15     use_token(:active) do
16       refute(Job.creatable?)
17     end
18   end
19 end