mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-05 00:19:47 +00:00
added test for capabilities
This commit is contained in:
parent
37a5332951
commit
5431b8c84b
1 changed files with 24 additions and 0 deletions
24
server/capability/capability_test.go
Normal file
24
server/capability/capability_test.go
Normal file
|
@ -0,0 +1,24 @@
|
|||
package capability
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"code.google.com/p/go.net/context"
|
||||
"github.com/franela/goblin"
|
||||
)
|
||||
|
||||
func TestBlobstore(t *testing.T) {
|
||||
caps := map[string]bool{}
|
||||
caps[Registration] = true
|
||||
|
||||
ctx := NewContext(context.Background(), caps)
|
||||
|
||||
g := goblin.Goblin(t)
|
||||
g.Describe("Capabilities", func() {
|
||||
|
||||
g.It("Should get capabilities from context", func() {
|
||||
g.Assert(Enabled(ctx, Registration)).Equal(true)
|
||||
g.Assert(Enabled(ctx, "Fake Key")).Equal(false)
|
||||
})
|
||||
})
|
||||
}
|
Loading…
Reference in a new issue