Assert team test exists
continuous-integration/drone/pr Build is failing Details

Signed-off-by: kolaente <k@knt.li>
This commit is contained in:
kolaente 2020-09-27 16:51:21 +02:00
parent 4c8d0353ae
commit b919c99704
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
1 changed files with 12 additions and 0 deletions

View File

@ -37,6 +37,11 @@ func TestTeam_Create(t *testing.T) {
}
err := team.Create(doer)
assert.NoError(t, err)
db.AssertDBExists(t, "teams", map[string]interface{}{
"id": team.ID,
"name": "Testteam293",
"description": "Lorem Ispum",
}, false)
})
t.Run("empty name", func(t *testing.T) {
db.LoadAndAssertFixtures(t)
@ -95,6 +100,10 @@ func TestTeam_Update(t *testing.T) {
}
err := team.Update()
assert.NoError(t, err)
db.AssertDBExists(t, "teams", map[string]interface{}{
"id": team.ID,
"name": "SomethingNew",
}, false)
})
t.Run("empty name", func(t *testing.T) {
db.LoadAndAssertFixtures(t)
@ -126,6 +135,9 @@ func TestTeam_Delete(t *testing.T) {
}
err := team.Delete()
assert.NoError(t, err)
db.AssertDBMissing(t, "teams", map[string]interface{}{
"id": 1,
})
})
}