-
Notifications
You must be signed in to change notification settings - Fork 64
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
[FEATURE] Create multiple examples for multiple tests for same error code. #177
Comments
Interesting. I did not know I am happy to accept pull request. I prefer it defaults to single |
Ok great. I'm in the middle of a project with a deadline and I haven't looked at the code yet. So I'm not sure when I'll be able to get started but I will notify here if and when I do. Please let me know if you have any recommendations on how you would architect / implement this. Thanks again! |
Hey--I'm realizing that this may be a killer bug for me... The issue effects not only outputs but inputs. I need to test that the API gives a 200 for good input and 400 for bad input--a very common use case. Unfortunately, the Let me know if there are any workarounds or if you think this might be a quick fix. Thank you |
Test cases can be excluded from OpenAPI generation with RSpec.describe '/resources', type: :request do
it 'returns a resource', openapi: false do
# ...
end
end |
The thing is, I'd like to document 400 responses as well. I think this will tide me over for now actually:
Thanks ! |
Great gem, thank you for sharing!
Here's a bug and a suggested feature to fix it.
The below is pseudo-code -- apologies if it doesn't work.
Steps to reproduce:
In your rspec tests, write something like:
Actual result:
It seems that only the response body received for the first or last test that is run is placed into examples. Because the test order is randomized, the output is therefore not deterministic. In other words, sometimes you'll see:
and sometimes you'll see
Expected result:
The output should be deterministic (ordered the same way every time, i.e. alphabetically) and should include all of the examples from tests.
i.e.
If you're open to it, I can work on a PR!
Thanks again!
The text was updated successfully, but these errors were encountered: