Skip to content

Use request_to matcher without with option #342

@ryz310

Description

@ryz310

I want to use request_to matcher without with option. But I've occurred following error:

Failure/Error:
       expect { api_request }.not_to request_to(:post, 'https://example.com/api')

     NoMethodError:
       undefined method `[]' for nil:NilClass
     # /usr/local/bundle/ruby/2.7.0/gems/my_api_client-0.17.0/lib/my_api_client/rspec/matchers/request_to.rb:11:in `block (2 levels) in <top (required)>'

The stack trace shows code that:

match do |api_request|
disable_logging
@expected = {
request_line: request_line(expected_method, expected_url, expected_options[:query]),
body: expected_options[:body],
headers: expected_options[:headers],
}.compact

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions