-
Notifications
You must be signed in to change notification settings - Fork 63
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
Running tests with OPENAPI=1 causes all request tests to fail #25
Comments
Could you provide a repository that reproduces the issue? |
I think I've found the problem, but I do not know why it is causing a problem. We are mounting a custom build engine at the top of the routes file and at the root of the project. Ie. Rails.application.routes.draw do
mount MyEngine::Engine => '/'
# ... rest of routes
end When I move the engine below the routes it works fine |
Thank you for reporting more details. Using the engine might have something to do with the issue. Because I haven't seen the issue in my apps, including ones using Rails engines, I still need a repository that captures your situation, or some instructions to reproduce it from |
Unfortunately I don't have enough time right now to build a repo that will reproduce, but what I found is that in this method, https://github.com/k0kubun/rspec-openapi/blob/4c6041952e478c32d5e7ee1e9745f8a5e6748a8a/lib/rspec/openapi/record_builder.rb#L65 it will be called recursively and on the first recursive call (aka 2nd call), all routes except the engine route have been removed. Feel free to close this. Thanks |
Yeah, I think the place could be relevant to your problem. However, I cannot fix what I cannot reproduce, so please feel free to take your time and reopen this when a repository that I can take a look at is ready. Thanks. |
Hi there,
I'm hoping to use this gem to automatically document our api, a wonderful thing. However, when I run our tests with
OPENAPI=1 rspec spec
every request spec fails withNo route matched for ....
. These tests pass when running rspec withoutOPENAPI=1
.All I have done is install the gem into the
:test
group andbundle install
Ideas?
The text was updated successfully, but these errors were encountered: