-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathusers_test.go
More file actions
35 lines (30 loc) · 817 Bytes
/
users_test.go
File metadata and controls
35 lines (30 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package _tests_test
import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Users", func() {
Context("when logged in as an admin user", func() {
BeforeEach(func() {
login(url, testAdminUser, testAdminPassword)
})
It("can list all users", func() {
output, err := execute("deis users:list")
Expect(err).NotTo(HaveOccurred())
Expect(output).To(SatisfyAll(
HavePrefix("=== Users"),
ContainSubstring(testUser),
ContainSubstring(testAdminUser)))
})
})
Context("when logged in as a normal user", func() {
BeforeEach(func() {
login(url, testUser, testPassword)
})
It("can't list all users", func() {
output, err := execute("deis users:list")
Expect(err).To(HaveOccurred())
Expect(output).To(ContainSubstring("403 FORBIDDEN"))
})
})
})