francesc / rails-translate-routes

MIT License
147 stars 50 forks source link

assert_recognizes needs locale param even with controller_test_helper included. #34

Open megatux opened 12 years ago

megatux commented 12 years ago

Hi, great Gem! Thanks a lot! This is more like a feature request. I've required the controller_test_helper so I don't need set the :locale param on my tests (like get :show, etc). That works great. But the assert_recognizes still needs the locale param or it would fail:

    assert_recognizes({:controller => "pages", :action => "brand"}, "brand")

to:

    assert_recognizes({:controller => "pages", :action => "brand", :locale => "en"}, "brand")

or this error occurs:

Failure:
  The recognized options <{"action"=>"brand", "controller"=>"pages", "locale"=>"en"}> did not match <{"action"=>"brand", "controller"=>"pages"}>, difference: <{"locale"=>"en"}>.
  <{"action"=>"brand", "controller"=>"pages"}> expected but was
  <{"action"=>"brand", "controller"=>"pages", "locale"=>"en"}>.

  diff:
  - {"action"=>"brand", "controller"=>"pages"}
  + {"action"=>"brand", "controller"=>"pages", "locale"=>"en"}
  ?                                          ++++++++++++++++
test_should_route_to_brand_actions(PagesControllerTest)

It would be nice if you don't have to.