You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've got two tests using the same method, path & query string, but different Auth headers.
My tests are there to ensure when a dodgy auth header is provided that the service I'm integrating with responds with a 401, and that I deal with that appropriately.
When recording the tests work fine but when replaying, all tests using the same method, path and, query string get the same HTTP response. So half the tests fail every time in my case.
Is this by design? I'm using one cassette file per fixture at the moment, using one per test would be an ok workaround but I'd prefer to group them if possible.
Thanks, and keep up the great work!
Rob
The text was updated successfully, but these errors were encountered:
robertbell
changed the title
Headers don't seem to be used when matching requests to cassette responses
Headers don't seem to be considered when matching requests to cassette responses
Sep 27, 2017
Hi,
Unfortunately the request matching is still a bit basic at the moment and only looks at the URL and the HTTP method.
As you mention, using a separate cassette file could be a workaround. Or you could vary the URL by, for example, adding an extra, ignorable query string param.
(I do intend to eventually add some more sophisticated matching - so watch this space)
That's fair enough. I'll go down the multiple cassette file route for now.
If you ever felt like accepting PRs on this project I'd be more than happy to pick up some tasks. I primarily write C# but I'm sure I could hit the ground running.
Hey there.
I've got two tests using the same method, path & query string, but different Auth headers.
My tests are there to ensure when a dodgy auth header is provided that the service I'm integrating with responds with a 401, and that I deal with that appropriately.
When recording the tests work fine but when replaying, all tests using the same method, path and, query string get the same HTTP response. So half the tests fail every time in my case.
Is this by design? I'm using one cassette file per fixture at the moment, using one per test would be an ok workaround but I'd prefer to group them if possible.
Thanks, and keep up the great work!
Rob
The text was updated successfully, but these errors were encountered: