cheald / manticore

Manticore is a JRuby HTTP client built on the Apache HttpClient 4.x components
https://gitlab.com/cheald/manticore
MIT License
54 stars 34 forks source link

Test fails on JRuby 9.2.0.0 - "sends a UTF-8 body" #75

Closed olleolleolle closed 6 years ago

olleolleolle commented 6 years ago

This test fails on JRuby 9.2.0.0.

    it "sends a UTF-8 body" do
      response = client.post(local_server, body: "This is a post body ∑")
      expect(JSON.load(response.body)["body"]).to eq "This is a post body ∑"
    end

Source location

Example failure:

  1) Manticore::Client#post sends a UTF-8 body
     Failure/Error: expect(JSON.load(response.body)["body"]).to eq "This is a post body ∑"

       expected: "This is a post body ∑"
            got: "This is a post body â\u0088\u0091"

       (compared using ==)
     # ./spec/manticore/client_spec.rb:461:in `block in (root)'

Test passes on 9.0.5.0 - https://travis-ci.org/cheald/manticore/jobs/383309866

Build 221 overview - https://travis-ci.org/cheald/manticore/builds/383309863

olleolleolle commented 6 years ago

OH: "Smells JI"

cheald commented 6 years ago

The fix for #70 and treating our test JSON payloads as application/json should fix this.

olleolleolle commented 6 years ago

@cheald Huzzah!