Convert joins to subqueries to fix duplicates in owned_items
[arvados.git] / services / api / test / test_helper.rb
index 3062c5283c063edc3bf4b343400e7a91a707179e..286cf66f28f240f00ea9aaf98bbb0ce5c13e7b8e 100644 (file)
@@ -9,6 +9,14 @@ class ActiveSupport::TestCase
   # -- they do not yet inherit this setting
   fixtures :all
 
+  teardown do
+    Thread.current[:api_client_ip_address] = nil
+    Thread.current[:api_client_authorization] = nil
+    Thread.current[:api_client_uuid] = nil
+    Thread.current[:api_client] = nil
+    Thread.current[:user] = nil
+  end
+
   def expect_json
     self.request.headers["Accept"] = "text/json"
   end
@@ -25,6 +33,15 @@ class ActiveSupport::TestCase
 end
 
 class ActionDispatch::IntegrationTest
+
+  teardown do
+    Thread.current[:api_client_ip_address] = nil
+    Thread.current[:api_client_authorization] = nil
+    Thread.current[:api_client_uuid] = nil
+    Thread.current[:api_client] = nil
+    Thread.current[:user] = nil
+  end
+
   def auth auth_fixture
     {'HTTP_AUTHORIZATION' => "OAuth2 #{api_client_authorizations(auth_fixture).api_token}"}
   end