2760: Delete name links too when deleting objects in pipeline instance tests.
[arvados.git] / apps / workbench / test / test_helper.rb
index c1eed5cd7bf6b56412749c7e4a7170d643fd4075..4293e7ebd3adcc0807784903a97ddd4076c8e94c 100644 (file)
@@ -31,7 +31,12 @@ class ActiveSupport::TestCase
   fixtures :all
   def use_token token_name
     auth = api_fixture('api_client_authorizations')[token_name.to_s]
+    token_was = Thread.current[:arvados_api_token]
     Thread.current[:arvados_api_token] = auth['api_token']
+    if block_given?
+      yield
+      Thread.current[:arvados_api_token] = token_was
+    end
   end
 
   def teardown