my_api_client icon indicating copy to clipboard operation
my_api_client copied to clipboard

Use `request_to` matcher without `with` option

Open ryz310 opened this issue 4 years ago • 0 comments

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:

https://github.com/ryz310/my_api_client/blob/3266c99498bd06b578752e11002cd4c693d974d4/lib/my_api_client/rspec/matchers/request_to.rb#L8-L14

ryz310 avatar Oct 27 '20 04:10 ryz310