X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/7d9cfb6e0716239f996bae054bc9345a663e0b7e..51c8987b2dd1696c27ee1235855a47bd86dfeb82:/apps/workbench/test/test_helper.rb diff --git a/apps/workbench/test/test_helper.rb b/apps/workbench/test/test_helper.rb index 1195798312..eea81d1b77 100644 --- a/apps/workbench/test/test_helper.rb +++ b/apps/workbench/test/test_helper.rb @@ -36,10 +36,15 @@ class ActiveSupport::TestCase Thread.current[:arvados_api_token] = auth['api_token'] end - def teardown + teardown do Thread.current[:arvados_api_token] = nil Thread.current[:reader_tokens] = nil - super + # Restore configuration settings changed during tests + $application_config.each do |k,v| + if k.match /^[^.]*$/ + Rails.configuration.send (k + '='), v + end + end end end @@ -56,7 +61,10 @@ module ApiFixtureLoader begin path = File.join(ApiServerForTests::ARV_API_SERVER_DIR, 'test', 'fixtures', "#{name}.yml") - YAML.load(IO.read(path)) + file = IO.read(path) + trim_index = file.index('# Test Helper trims the rest of the file') + file = file[0, trim_index] if trim_index + YAML.load(file) end end end