railsware/js-routes — pull request #123 by olance (2014-09-03 20:06:44+00:00)
Title: Feature: routes path specs

Closes #122

As discussed in #122, here's a PR to add a `spec()` function to route helpers.
It is computed in the `build_path_spec` method from the route's binary tree, with bonus codesize-per-route reduction ;)

I had to change one test and remove two because of the way routes are now built:
```ruby
it "should have correct function without arguments signature" => it "should call route function for each route"
it "should have correct function with arguments signature" => pending
it "should have correct function signature with unordered hash" => pending
```
The reason is that we do not create one function per route with arguments names anymore. (the arguments names were not used anyway, as `build_path` was given `arguments` directly)

I have added tests in the `path_specs_generation_spec.rb` spec file. All routes are loaded and two examples are dynamically created for each route, so that if one example fails, we directly know for which route (I have included the name of the route in the examples names).