Skip to content

Commit

Permalink
add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
micbar committed Mar 9, 2022
1 parent 67a1716 commit 12ded3e
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion pkg/storage/utils/decomposedfs/spaces_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,14 @@ package decomposedfs_test
import (
permissionsv1beta1 "github.com/cs3org/go-cs3apis/cs3/permissions/v1beta1"
rpcv1beta1 "github.com/cs3org/go-cs3apis/cs3/rpc/v1beta1"
provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
helpers "github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/testhelpers"
. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
"github.com/stretchr/testify/mock"
)

var _ = Describe("Home is Created", func() {
var _ = Describe("Create Spaces", func() {
var (
env *helpers.TestEnv
)
Expand Down Expand Up @@ -55,4 +56,15 @@ var _ = Describe("Home is Created", func() {
Expect(resp[0].SpaceType).To(Equal("personal"))
})
})
Context("when creating a space", func() {
It("project space is created", func() {
resp, err := env.Fs.CreateStorageSpace(env.Ctx, &provider.CreateStorageSpaceRequest{Name: "Mission to Mars", Type: "project"})
Expect(err).ToNot(HaveOccurred())
Expect(resp.Status.Code).To(Equal(rpcv1beta1.Code_CODE_OK))
Expect(resp.StorageSpace).ToNot(Equal(nil))
Expect(string(resp.StorageSpace.Opaque.Map["spaceAlias"].Value)).To(Equal("project/mission-to-mars"))
Expect(resp.StorageSpace.Name).To(Equal("Mission to Mars"))
Expect(resp.StorageSpace.SpaceType).To(Equal("project"))
})
})
})

0 comments on commit 12ded3e

Please sign in to comment.