[MM-29731] Fix panic in saveUserTermsOfService (#16044)
* Fix panic in saveUserTermsOfService * Remove unneeded initialization
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
91bb7d3b11
Коммит
e5e2dbdf1a
@@ -828,6 +828,17 @@ func TestGetUserByUsernameWithAcceptedTermsOfService(t *testing.T) {
|
||||
require.Equal(t, tos.Id, ruser.TermsOfServiceId, "Terms of service ID should match")
|
||||
}
|
||||
|
||||
func TestSaveUserTermsOfService(t *testing.T) {
|
||||
th := Setup(t)
|
||||
defer th.TearDown()
|
||||
|
||||
t.Run("Invalid data", func(t *testing.T) {
|
||||
resp, err := th.Client.DoApiPost("/users/"+th.BasicUser.Id+"/terms_of_service", "{}")
|
||||
require.NotNil(t, err)
|
||||
assert.Equal(t, http.StatusBadRequest, resp.StatusCode)
|
||||
})
|
||||
}
|
||||
|
||||
func TestGetUserByEmail(t *testing.T) {
|
||||
th := Setup(t)
|
||||
defer th.TearDown()
|
||||
|
||||
Ссылка в новой задаче
Block a user