Skip to content

Instantly share code, notes, and snippets.

@firedev
Created January 21, 2014 14:41
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save firedev/8541276 to your computer and use it in GitHub Desktop.
Save firedev/8541276 to your computer and use it in GitHub Desktop.
Fix for Rails locales when testing with Rspec, Capybara etc...
# spec/support/routing_helper.rb
class ActionDispatch::Routing::RouteSet::NamedRouteCollection::UrlHelper
def call(t, args)
t.url_for(handle_positional_args(t, args, { locale: nil }.merge( @options ), @segment_keys))
end
end
@kaleemullah
Copy link

Its not working with rails-4.2.1.

@stupid-troll
Copy link

Failure/Error:
       def call(t, args)
         t.url_for(handle_positional_args(t, args, { locale: nil }.merge( @options ), @segment_keys))

     ArgumentError:
       wrong number of arguments (3 for 2)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment