X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/c2ccba382871ecad4f9336f250a90a95d8f5b987..c18bde8300e115b215e58d6930d0495b2c33b49f:/apps/workbench/test/test_helper.rb diff --git a/apps/workbench/test/test_helper.rb b/apps/workbench/test/test_helper.rb index 145914f741..cbbf562afa 100644 --- a/apps/workbench/test/test_helper.rb +++ b/apps/workbench/test/test_helper.rb @@ -6,13 +6,21 @@ $ARV_API_SERVER_DIR = File.expand_path('../../../../services/api', __FILE__) SERVER_PID_PATH = 'tmp/pids/server.pid' class ActiveSupport::TestCase - # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order. + # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in + # alphabetical order. # - # Note: You'll currently still have to declare fixtures explicitly in integration tests - # -- they do not yet inherit this setting + # Note: You'll currently still have to declare fixtures explicitly + # in integration tests -- they do not yet inherit this setting fixtures :all + def use_token token_name + auth = api_fixture('api_client_authorizations')[token_name.to_s] + Thread.current[:arvados_api_token] = auth['api_token'] + end - # Add more helper methods to be used by all tests here... + def teardown + Thread.current[:arvados_api_token] = nil + super + end end module ApiFixtureLoader