Log status code when failing to authenticate with OAuth provider (#10819)

Этот коммит содержится в:
Harrison Healey
2019-05-14 13:34:22 -04:00
коммит произвёл GitHub
родитель 68da625802
Коммит 0214ad69e5
2 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@@ -327,6 +327,7 @@ func TestAuthorizeOAuthUser(t *testing.T) {
_, _, _, err := th.App.AuthorizeOAuthUser(&httptest.ResponseRecorder{}, request, model.SERVICE_GITLAB, "", state, "")
require.NotNil(t, err)
assert.Equal(t, "api.user.authorize_oauth_user.bad_response.app_error", err.Id)
assert.Contains(t, err.DetailedError, "status_code=418")
})
t.Run("with an invalid token response", func(t *testing.T) {
@@ -345,6 +346,7 @@ func TestAuthorizeOAuthUser(t *testing.T) {
_, _, _, err := th.App.AuthorizeOAuthUser(&httptest.ResponseRecorder{}, request, model.SERVICE_GITLAB, "", state, "")
require.NotNil(t, err)
assert.Equal(t, "api.user.authorize_oauth_user.bad_response.app_error", err.Id)
assert.Contains(t, err.DetailedError, "response_body=invalid")
})
t.Run("with an invalid token type", func(t *testing.T) {