From 5431b8c84b6feedc6a5983e499fed2f7a2cf4d4a Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Wed, 1 Oct 2014 10:09:13 -0700 Subject: [PATCH] added test for capabilities --- server/capability/capability_test.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 server/capability/capability_test.go diff --git a/server/capability/capability_test.go b/server/capability/capability_test.go new file mode 100644 index 000000000..b0ffe2ae3 --- /dev/null +++ b/server/capability/capability_test.go @@ -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) + }) + }) +}