kwi/i18n_routing — pull request #27 by jensb (2011-10-09 18:04:06+00:00)
Title: Added some failing tests with named_route and url_for: why do these fail?

Hello,

when using named_route paths with multiple parameters, translations are not detected (so paths are not translated). Attached is a patch which adds four failing tests, to test this.

Failures:

1) localized_routes routes in loop and controller blocks translated named route, from
Failure/Error: routes.send(:from_search_path, :country => 'DE', :city => 'HH', :type => 'from').should == '/von/DE/HH'
expected: "/von/DE/HH"
got: "/from/DE/HH" (using ==)
# ./spec/i18n_routing/i18n_spec.rb:259

2) localized_routes routes in loop and controller blocks translated named route, to
Failure/Error: routes.send(:to_search_path, :country => 'DE', :city => 'HH', :type => 'to').should == '/nach/DE/HH'
expected: "/nach/DE/HH"
got: "/to/DE/HH" (using ==)
# ./spec/i18n_routing/i18n_spec.rb:262

3) localized_routes routes in loop and controller blocks translated url_for, from
Failure/Error: url_for(:controller => :search, :action => :show, :country => 'DE', :city => 'HH', :type => 'from').should == '/von/DE/HH'
expected: "/von/DE/HH"
got: "/from/DE/HH" (using ==)
# ./spec/i18n_routing/i18n_spec.rb:265

4) localized_routes routes in loop and controller blocks translated url_for, to
Failure/Error: url_for(:controller => :search, :action => :show, :country => 'DE', :city => 'HH', :type => 'to').should == '/nach/DE/HH'
expected: "/nach/DE/HH"
got: "/to/DE/HH" (using ==)
# ./spec/i18n_routing/i18n_spec.rb:268