-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Allow routing specs to access engine routes #668
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
Conversation
Thanks for the report! Could you create a small Rails app that demonstrates the problem and push it up to GitHub? I'm not able to figure out what's going on with just the details so far. |
Here's an example application:
Thank you for taking a look. |
The repo is incredibly helpful, thank you. I'm digging into the issue now. |
I'm working on this, but it's unlikely to continue working by setting |
A workaround for now is: before do
assertion_instance.instance_variable_set(:@routes, @routes)
end I know this sucks, but we're in a hard spot trying to support this alongside Rails 4. I'm working on it soon :) |
Thanks, |
+1 |
* For example, when testing Rails engines [Closes #668]
@stas, @evgeny-myasishchev: would you look at my proposed solution, try it out, and give feedback? The branch name is |
Just tried, works great! |
|
Allow routing specs to access engine routes
Merged. It will appear in rspec-rails 2.14. You can pin to a git revision in the time being, but hopefully it won't be terribly long before another release :) |
Thank you. |
Great, thanks a lot! :) |
Thank you so much for fixing this. ❤️ ❤️ Thanks 👏 |
* For example, when testing Rails engines [Closes #668]
I have a Rails Engine with routes defined in my app.
After upgrade all routing tests fail with No route matches...
I was trying to debug the MyEngine::Engine.routes.router and here's the diff
On latest rspec-rails
@ast
is always nil.