X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/2d4263c16812a906589cbc13be26535a85691bd8..4eba2cb5d7d6a5d76b9ce4d3f535a1de911400cd:/services/api/test/test_helper.rb diff --git a/services/api/test/test_helper.rb b/services/api/test/test_helper.rb index 8bf1192ffe..8e3399523e 100644 --- a/services/api/test/test_helper.rb +++ b/services/api/test/test_helper.rb @@ -9,5 +9,22 @@ class ActiveSupport::TestCase # -- they do not yet inherit this setting fixtures :all + def expect_json + self.request.headers["Accept"] = "text/json" + end + + def authorize_with(api_client_auth_name) + self.request.env['HTTP_AUTHORIZATION'] = "OAuth2 #{api_client_authorizations(api_client_auth_name).api_token}" + end + # Add more helper methods to be used by all tests here... end + +class ActionDispatch::IntegrationTest + def jresponse + @jresponse ||= ActiveSupport::JSON.decode @response.body + end +end + +# Ensure permissions are computed from the test fixtures. +User.invalidate_permissions_cache