1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-23 23:29:42 +02:00

test space update

This commit is contained in:
Harvey Kandola 2017-09-01 15:57:10 +01:00
parent d6a17d5a56
commit 6ecf5a87cd

View file

@ -39,6 +39,32 @@ func TestSpace(t *testing.T) {
} }
}) })
t.Run("Update Space", func(t *testing.T) {
ctx.Transaction, err = rt.Db.Beginx()
sp, err := s.Space.Get(ctx, spaceID)
if err != nil {
ctx.Transaction.Rollback()
t.Error("failed to get space")
return
}
sp.Name = "test update"
err = s.Space.Update(ctx, sp)
if err != nil {
ctx.Transaction.Rollback()
t.Error("failed to update space")
return
}
ctx.Transaction.Commit()
sp, err = s.Space.Get(ctx, spaceID)
if err != nil || sp.Name != "test update" {
t.Error("failed to update space")
}
})
t.Run("Delete Space", func(t *testing.T) { t.Run("Delete Space", func(t *testing.T) {
ctx.Transaction, err = rt.Db.Beginx() ctx.Transaction, err = rt.Db.Beginx()