Skip to content
This repository was archived by the owner on Nov 15, 2024. It is now read-only.

Conversation

@dimkene
Copy link
Owner

@dimkene dimkene commented Mar 26, 2024

No description provided.

Copy link

@ivannizh ivannizh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Привет! Хорошая работа! Осталось исправить некоторые моменты и работа будет принята.

main_test.go Outdated
require.NotEmpty(t, responseRecorder.Code)

status := responseRecorder.Code
require.Equal(t, status, http.StatusOK)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Перепутаны местами 2 и 3 аргумент

main_test.go Outdated
handler := http.HandlerFunc(mainHandle)
handler.ServeHTTP(responseRecorder, req)

require.NotEmpty(t, responseRecorder.Code)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно тело запроса проверить на пустоту, а код и так в 22 строчке проверяется

handler.ServeHTTP(responseRecorder, req)

body := responseRecorder.Body.String()
assert.Equal(t, "wrong city value", body)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нет проверки статуса ответа

main_test.go Outdated
require.NotEmpty(t, responseRecorder.Code)

status := responseRecorder.Code
require.Equal(t, status, http.StatusOK)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Поменяй местами 2 и 3 аргумент

main_test.go Outdated
require.Equal(t, status, http.StatusOK)

body := responseRecorder.Body.String()
assert.NotEqual(t, "wrong city value", body)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Достаточно странная проверка, но можно.

Странная в том плане, что мы и так в 51 строке проверяем, что там есть кафе и просто лишняя проверка

Copy link

@ivannizh ivannizh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Отлично, принято!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants