-
Notifications
You must be signed in to change notification settings - Fork 0
first test #1
base: main
Are you sure you want to change the base?
first test #1
Conversation
ivannizh
left a comment
There was a problem hiding this 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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this 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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Достаточно странная проверка, но можно.
Странная в том плане, что мы и так в 51 строке проверяем, что там есть кафе и просто лишняя проверка
ivannizh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Отлично, принято!
No description provided.