enriclluelles/route_translator

routing specs

Closed this issue · 1 comments

Is it possible to write routing specs for localized routes?

I have a route like this:

localized do
  root to: 'my_controller#show'
end

If I write something like this:
expect(get: '/en').to route_to(controller: 'my_controller', action: 'show', locale: 'en')

it fails and reports that the actual options (vs the expected that I specified) are:
{"controller"=>"my_controlle", "action"=>"show", "locale"=>"sr", "id"=>"en"}

sr is default locale.

It turned out that this approach (using localized routes) introduces more complexity in my project then it simplifies the usage, so I got rid of it (at least for now). I will close the issue, but if you think that the question is legitimate, perhaps you may want to add the info to the readme.