Example #1
0
				It("returns 500", func() {
					Expect(response.StatusCode).To(Equal(http.StatusInternalServerError))
				})
			})
		})
	})

	Describe("GET /api/v1/pipelines/:pipeline_name/jobs/:job_name/builds", func() {
		var response *http.Response
		var queryParams string

		JustBeforeEach(func() {
			var err error

			pipelineDB.GetPipelineNameReturns("some-pipeline")
			response, err = client.Get(server.URL + "/api/v1/pipelines/some-pipeline/jobs/some-job/builds" + queryParams)
			Expect(err).NotTo(HaveOccurred())
		})

		Context("when no params are passed", func() {
			It("does not set defaults for since and until", func() {
				Expect(pipelineDB.GetJobBuildsCallCount()).To(Equal(1))

				jobName, page := pipelineDB.GetJobBuildsArgsForCall(0)
				Expect(jobName).To(Equal("some-job"))
				Expect(page).To(Equal(db.Page{
					Since: 0,
					Until: 0,
					Limit: 100,
				}))