11185: Merge branch 'master' into 11185-wb-disable-reuse
[arvados.git] / apps / workbench / test / unit / disabled_api_test.rb
1 require 'test_helper'
2
3 class DisabledApiTest < ActiveSupport::TestCase
4   test 'Job.creatable? reflects whether jobs.create API is enabled' do
5     use_token(:active) do
6       assert(Job.creatable?)
7     end
8     dd = ArvadosApiClient.new_or_current.discovery.deep_dup
9     dd[:resources][:jobs][:methods].delete(:create)
10     ArvadosApiClient.any_instance.stubs(:discovery).returns(dd)
11     use_token(:active) do
12       refute(Job.creatable?)
13     end
14   end
15 end