mirror of
https://github.com/documize/community.git
synced 2025-07-23 07:09:43 +02:00
test space update
This commit is contained in:
parent
d6a17d5a56
commit
6ecf5a87cd
1 changed files with 26 additions and 0 deletions
|
@ -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) {
|
||||
ctx.Transaction, err = rt.Db.Beginx()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue