Skip to content

Request method comparison is case sensitive #40

@gdotdesign

Description

@gdotdesign

I am building an integration and testing it with WebMock and run into this issue.

given I have this mock:

WebMock.stub(:get, "https://api.sandbox.paypal.com/v2/checkout/orders/ORDER_ID")
  .to_return(body: {
    "id"     => "ID",
    "status" => "COMPLETED",
  }.to_json)

and this request:

HTTP::Client
  .new(URI.parse("https://api.sandbox.paypal.com"))
  .exec("get", "/v2/checkout/orders/ORDER_ID")

The request is not handled by WebMock, and the reason is that the method comparison is case sensitive: https://github.com/manastech/webmock.cr/blob/master/src/webmock/stub.cr#L66 in this case "get" == "GET"

I don't have time to fix it now, but I might do it later, using uppercase methods as a workaround now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions