Mocking Requests With Partial URIs Using Regex
Last updated
Was this helpful?
Last updated
Was this helpful?
Generally when mocking out requests with the gem, we specify full request URIs like so:
We may not want to specify the entire URI though. For instance, the host may change or be configurable. The stub_request
method allows us to use regex.
Using , we are able to avoid escaping all of the /
characters in our URI.
h/t Brian Dunn