This project is archived and is in readonly mode.
url_helpers not available in sweepers in test environment
-
Neeraj Singh
It seems you already know the solution. Can you provide a code patch and a test?
-
Wincent Colaiuta
- Importance changed from to Low
Well, I don't actually know the solution, I only know a workaround: ie. explicitly including the url helpers in each sweeper (this effectively means that in the development and production environments they get included twice, but it seems harmless).
I've tried to trace through the code paths in the different environments to work out why the helpers are included in one two environments and not the others, but I haven't yet been able to figure it out. I haven't given up trying though, just haven't had time to get to the bottom of it yet.
As for the test, yes, I can probably get that done even if I can't figure out the real cause.
-
Andrew White
I'm pretty sure the reason is that if you've a big routes.rb file you probably don't want them loaded in every test case. That way you can include them in the ones that matter or define a subset of routes in the test.
-
Santiago Pastorino
- State changed from new to open
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.
Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.
-
Santiago Pastorino
- State changed from open to stale