If parameter expects not `1`, it fails
Closed this issue · 1 comments
ohbarye commented
Problem
If there's a path that expects a parameter to be a specific format, it fails.
e.g.
scope ':locale', locale: /en|ja/ do
get '/locale_test' => 'users#index'
end
- It expects
/en|ja/
, - But
route_mechanic
always gives1
as a parameter in the path.
Solution
I came up with 2 ideas as follow.
- Use https://github.com/tom-lord/regexp-examples and generate an example parameter that meets requirements.
- Remove
assert_routes
since it's not the main work of this gem.
I kinda want to choose the 2nd option because assert_*
cause some problems like this and #7.
Thank you @pocke for reporting.
ohbarye commented