1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
package koofrclient_test
import (
k "github.com/koofr/go-koofrclient"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Client", func() {
It("should create client with token", func() {
c := k.NewKoofrClient(apiBase, true)
Expect(c).NotTo(BeNil())
c.SetToken("eac6e8d7-edea-4af1-92db-9636795379d1")
Expect(c).NotTo(BeNil())
})
It("should create client and authorize", func() {
c := k.NewKoofrClient(apiBase, true)
Expect(c).NotTo(BeNil())
err := c.Authenticate(email, password)
Expect(err).NotTo(HaveOccurred())
Expect(c.GetToken()).To(HaveLen(36))
})
})
|