Merge branch 'master' into 3990-owner-when-rerunning-pipeline
[arvados.git] / apps / workbench / test / test_helper.rb
index 72469bc0598af198ade1db06a2b7880c1994530c..5253676578e18b4eaf0692db37c1358b34c092d3 100644 (file)
@@ -22,6 +22,7 @@ end
 
 require File.expand_path('../../config/environment', __FILE__)
 require 'rails/test_help'
+require 'mocha/mini_test'
 
 class ActiveSupport::TestCase
   # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in
@@ -35,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