test/api_access_test.rb in gds-sso-1.2.2 vs test/api_access_test.rb in gds-sso-2.0.0
- old
+ new
@@ -11,6 +11,17 @@
def test_application_json_accept_header_is_considered_to_be_api_call
assert GDS::SSO::ApiAccess.api_call?('HTTP_ACCEPT' => 'application/json')
end
+ def test_request_with_authorization_header_is_oauth_api_call
+ assert GDS::SSO::ApiAccess.oauth_api_call?('HTTP_AUTHORIZATION' => 'Bearer blahblahblah')
+ end
+
+ def test_request_with_http_basic_authorization_header_is_not_oauth_api_call
+ refute GDS::SSO::ApiAccess.oauth_api_call?('HTTP_AUTHORIZATION' => 'Basic Some basic credentials')
+ end
+
+ def test_request_with_empty_authorization_header_is_not_oauth_api_call
+ refute GDS::SSO::ApiAccess.oauth_api_call?('HTTP_AUTHORIZATION' => '')
+ end
end
\ No newline at end of file