railsware/js-routes — pull request #22 by baconpat (2011-10-21 17:53:18+00:00)
Title: Fix for js-routes in asset pipeline

The js-routes.js.erb file is currently written to only generate the js routes if the JsRoutes.assert_usable_configuration! method returns true. That method raises an exception when Rails isn't configured properly. But it was returning nil when it didn't raise an exception.

I changed the method to return true when no exception is raised.

I made some attempts to test my changes. I had to remove a memoizing member variable (@usable_configuration) from the assert_usable_configuration! implementation though. It would remember the config values from the first test that is run, making it impossible to properly test other scenarios.