From: Tom Clegg Date: Mon, 6 Oct 2014 16:00:50 +0000 (-0400) Subject: 3782: Restore config settings changed during tests. (copied from API server) X-Git-Tag: 1.1.0~2130^2~3 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/3e2927123ab9c6c8ab48b50ed65490f809e9e18a 3782: Restore config settings changed during tests. (copied from API server) --- diff --git a/apps/workbench/test/test_helper.rb b/apps/workbench/test/test_helper.rb index 1195798312..5253676578 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