Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed matcher for content-type in VerifyJSONRepresenting #377

Merged
merged 1 commit into from
Mar 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion ghttp/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ func VerifyJSONRepresenting(object interface{}) http.HandlerFunc {
data, err := json.Marshal(object)
Expect(err).ShouldNot(HaveOccurred())
return CombineHandlers(
VerifyContentType("application/json"),
VerifyMimeType("application/json"),
VerifyJSON(string(data)),
)
}
Expand Down
2 changes: 1 addition & 1 deletion ghttp/test_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ var _ = Describe("TestServer", func() {

It("should verify the json body and the content type", func() {
failures := InterceptGomegaFailures(func() {
http.Post(s.URL()+"/foo", "application/json", bytes.NewReader([]byte(`[1,3]`)))
http.Post(s.URL()+"/foo", "application/json; charset=utf-8", bytes.NewReader([]byte(`[1,3]`)))
})
Expect(failures).Should(HaveLen(1))
})
Expand Down