3782: Restore config settings changed during tests. (copied from API server)
authorTom Clegg <tom@curoverse.com>
Mon, 6 Oct 2014 16:00:50 +0000 (12:00 -0400)
committerTom Clegg <tom@curoverse.com>
Mon, 6 Oct 2014 16:00:50 +0000 (12:00 -0400)
apps/workbench/test/test_helper.rb

index 11957983122d3a7942bfcc18f3074dcf67fceb55..5253676578e18b4eaf0692db37c1358b34c092d3 100644 (file)
@@ -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