Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Response matching needs to support default responses #86

Open
harrisj opened this issue Jun 17, 2016 · 3 comments
Open

Response matching needs to support default responses #86

harrisj opened this issue Jun 17, 2016 · 3 comments

Comments

@harrisj
Copy link

harrisj commented Jun 17, 2016

Currently, explicit spec validation using the expect(subject).to validate method will not work with default response types because the validator converts the argument to an int and then the checker converts back to a string (so 'default' becomes 0 becomes '0')

@jpsilvashy
Copy link

I'm also having this issue, and seems we have a duplicate issue: #85

@harrisj have you figured out a work around for this, I'm somewhat stuck.

@ashoda
Copy link
Collaborator

ashoda commented Feb 14, 2017

@harrisj thanks for reporting this.

This does seem like a bug. Beyond the string to int to string conversion, Apivore asserts that the specified status code matches the response status code. Seems like the most reasonable thing to do is to skip the status code assertion in the case of "default".

@jreece1567, @gwshaw any thoughts on this issue.

@abrahamchaibi
Copy link

abrahamchaibi commented May 4, 2017

having the same problem as well, hard to round out a test suite without support for default!

awesome added a commit to awesome/mini-apivore that referenced this issue Feb 24, 2018
"Response matching needs to support 'default' responses"; see: westfieldlabs/apivore#86
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants