Skip to content

Instantly share code, notes, and snippets.

@firedev
Created January 21, 2014 14:41
Show Gist options
  • 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
@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