test(server): check for returned vars being not empty on list trainings
This commit is contained in:
parent
7c4c42f1b2
commit
f2bab62e08
1 changed files with 7 additions and 0 deletions
|
|
@ -163,6 +163,13 @@ func TestServer(t *testing.T) {
|
||||||
err := json.NewDecoder(rr.Body).Decode(&trainings)
|
err := json.NewDecoder(rr.Body).Decode(&trainings)
|
||||||
assert.NoError(t, err, "error unmarshalling response")
|
assert.NoError(t, err, "error unmarshalling response")
|
||||||
assert.Greater(t, len(trainings), 0)
|
assert.Greater(t, len(trainings), 0)
|
||||||
|
|
||||||
|
for _, trr := range trainings {
|
||||||
|
assert.NotEmpty(t, trr.Name)
|
||||||
|
assert.NotEmpty(t, trr.Slug)
|
||||||
|
assert.NotEmpty(t, trr.Description)
|
||||||
|
assert.NotEmpty(t, trr.Days)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
t.Run("Update training", func(t *testing.T) {
|
t.Run("Update training", func(t *testing.T) {
|
||||||
|
|
|
||||||
Reference in a new issue