Codebase list golang-gomega / 6024f5b
Changed matcher for content-type in VerifyJSONRepresenting (#377) Resolves #372 kucherenkovova authored 4 years ago GitHub committed 4 years ago
2 changed file(s) with 2 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
136136 data, err := json.Marshal(object)
137137 Expect(err).ShouldNot(HaveOccurred())
138138 return CombineHandlers(
139 VerifyContentType("application/json"),
139 VerifyMimeType("application/json"),
140140 VerifyJSON(string(data)),
141141 )
142142 }
587587
588588 It("should verify the json body and the content type", func() {
589589 failures := InterceptGomegaFailures(func() {
590 http.Post(s.URL()+"/foo", "application/json", bytes.NewReader([]byte(`[1,3]`)))
590 http.Post(s.URL()+"/foo", "application/json; charset=utf-8", bytes.NewReader([]byte(`[1,3]`)))
591591 })
592592 Expect(failures).Should(HaveLen(1))
593593 })