Changed matcher for content-type in VerifyJSONRepresenting (#377)
Resolves #372
kucherenkovova authored 4 years ago
GitHub committed 4 years ago
136 | 136 |
data, err := json.Marshal(object)
|
137 | 137 |
Expect(err).ShouldNot(HaveOccurred())
|
138 | 138 |
return CombineHandlers(
|
139 | |
VerifyContentType("application/json"),
|
|
139 |
VerifyMimeType("application/json"),
|
140 | 140 |
VerifyJSON(string(data)),
|
141 | 141 |
)
|
142 | 142 |
}
|
587 | 587 |
|
588 | 588 |
It("should verify the json body and the content type", func() {
|
589 | 589 |
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]`)))
|
591 | 591 |
})
|
592 | 592 |
Expect(failures).Should(HaveLen(1))
|
593 | 593 |
})
|