9799: Fix show/hide "cancel container req" button: check ArvadosBase#editable?, and...
[arvados.git] / apps / workbench / test / test_helper.rb
index 78ef2d21f1a15a106c000710c440984b5a210b16..73bfda6ae626c79b165634e1b81a6076b7809fcb 100644 (file)
@@ -32,14 +32,16 @@ class ActiveSupport::TestCase
   # in integration tests -- they do not yet inherit this setting
   fixtures :all
   def use_token token_name
-    was = Thread.current[:arvados_api_token]
+    user_was = Thread.current[:user]
+    token_was = Thread.current[:arvados_api_token]
     auth = api_fixture('api_client_authorizations')[token_name.to_s]
     Thread.current[:arvados_api_token] = auth['api_token']
     if block_given?
       begin
         yield
       ensure
-        Thread.current[:arvados_api_token] = was
+        Thread.current[:user] = user_was
+        Thread.current[:arvados_api_token] = token_was
       end
     end
   end