api: structure: backfill list containers instance var test
In the previous commit, I fixed a bug where the instance vars weren't
being properly applied for the list containers endpoint. This backfills
a test so we have some coverage
@@ -232,6 +232,24 @@ var _ = Describe("Containers API", func() {
})
})
+ Describe("querying with pipeline instance vars", func() {
+ BeforeEach(func() {
+ req.URL.RawQuery = url.Values{
+ "vars": []string{`{"branch":"master"}`},
+ }.Encode()
+ })
+
+ It("queries with it in the metadata", func() {
+ _, err := client.Do(req)
+ Expect(err).NotTo(HaveOccurred())
+
+ meta := dbTeam.FindContainersByMetadataArgsForCall(0)
+ Expect(meta).To(Equal(db.ContainerMetadata{
+ PipelineInstanceVars: `{"branch":"master"}`,
+ }))
+ })
+ })
+
Describe("querying with job id", func() {
BeforeEach(func() {
req.URL.RawQuery = url.Values{
