Skip to content
This repository has been archived by the owner on May 6, 2021. It is now read-only.

Commit

Permalink
Test errors when failing to get space
Browse files Browse the repository at this point in the history
Probably need some better detection tho and more use cases,
  • Loading branch information
chmouel committed Nov 29, 2018
1 parent 5dbbe3a commit 99210e2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions controller/pipeline_environments_blackbox_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,15 @@ func (s *PipelineEnvironmentControllerSuite) TestCreate() {
jerr := s.ctrl2.Create(createCtxerr)
require.Nil(t, jerr)
require.Equal(t, 400, rw.Code)

failSpaceID := uuid.NewV4()
gock.New("http://witservice").
Get("/api/spaces/" + failSpaceID.String()).
Reply(404)
// TODO(chmouel): better testing
payload = newPipelineEnvironmentPayload("space-not-found", uuid.NewV4())
test.CreatePipelineEnvironmentsInternalServerError(t, s.ctx2, s.svc2, s.ctrl2, space1ID, payload)
require.NotNil(t, response.Header().Get("Location"))
})

s.T().Run("unauthorized", func(t *testing.T) {
Expand Down

0 comments on commit 99210e2

Please sign in to comment.