Skip to content

Commit

Permalink
Unfocusing test; removed unnecessary test
Browse files Browse the repository at this point in the history
[#160565578]

Signed-off-by: Mark DeLillo <[email protected]>
  • Loading branch information
TisVictress authored and mdelillo committed Oct 8, 2018
1 parent db436a8 commit 434d1d2
Showing 1 changed file with 1 addition and 36 deletions.
37 changes: 1 addition & 36 deletions credhub/permissions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
var _ = Describe("Permissions", func() {
Context("GetPermission", func() {
Context("when server version is less than 2.0.0", func() {
FIt("returns permission using V1 endpoint", func() {
It("returns permission using V1 endpoint", func() {
responseString :=
`{
"credential_name":"/test-password",
Expand Down Expand Up @@ -83,40 +83,6 @@ var _ = Describe("Permissions", func() {
Expect(dummyAuth.Request.Method).To(Equal(http.MethodGet))
})
})

Context("when server version is not specified", func() {
var server *ghttp.Server

BeforeEach(func() {
server = ghttp.NewServer()
server.AppendHandlers(
ghttp.CombineHandlers(
ghttp.VerifyRequest("GET", "/info"),
ghttp.RespondWith(http.StatusOK, `{}`),
),
ghttp.CombineHandlers(
ghttp.VerifyRequest("GET", "/version"),
ghttp.RespondWith(http.StatusOK, `{"version": "1.9.0"}`),
),
ghttp.CombineHandlers(
ghttp.VerifyRequest("GET", "/api/v1/permissions"),
ghttp.RespondWith(http.StatusOK, `{}`),
),
)
})

AfterEach(func() {
//shut down the server between tests
server.Close()
})

It("returns permission", func() {
ch, _ := New(server.URL())
_, err := ch.GetPermission("name")
Expect(err).NotTo(HaveOccurred())
Expect(server.ReceivedRequests()).To(HaveLen(3))
})
})
})

Context("AddPermission", func() {
Expand Down Expand Up @@ -224,4 +190,3 @@ var _ = Describe("Permissions", func() {
})
})
})

0 comments on commit 434d1d2

Please sign in to comment.