In my cache sweeper I call expire_fragment and use some named route
helpers for its argument (like comments_path(…)).
This works fine in the app, but in my tests it’s causing problems,
because there’s no controller and comments_path returns nil. (See
method_missing in actionpack/lib/action_controller/caching/sweeper.rb
– that’s what’s returning nil in this case. I don’t understand why
that’s acceptable, but whatever.)
When my tests run Comment.create() directly, the sweeper gets called,
with no controller. How can I get to comments_path in this case?