projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add persistent/cache switch to collections index page.
[arvados.git]
/
services
/
api
/
test
/
test_helper.rb
diff --git
a/services/api/test/test_helper.rb
b/services/api/test/test_helper.rb
index a81bfdf9e40c1bb03af90a274a1fe68645c534b0..a4c1445f3b10789ee5f7865d33a572d41bacbab6 100644
(file)
--- a/
services/api/test/test_helper.rb
+++ b/
services/api/test/test_helper.rb
@@
-9,6
+9,14
@@
class ActiveSupport::TestCase
# -- they do not yet inherit this setting
fixtures :all
# -- 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
def expect_json
self.request.headers["Accept"] = "text/json"
end
@@
-21,9
+29,19
@@
class ActiveSupport::TestCase
end
class ActionDispatch::IntegrationTest
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 jresponse
@jresponse ||= ActiveSupport::JSON.decode @response.body
end
def jresponse
@jresponse ||= ActiveSupport::JSON.decode @response.body
end
+
def auth auth_fixture
{'HTTP_AUTHORIZATION' => "OAuth2 #{api_client_authorizations(auth_fixture).api_token}"}
end
def auth auth_fixture
{'HTTP_AUTHORIZATION' => "OAuth2 #{api_client_authorizations(auth_fixture).api_token}"}
end