Class: ActionView::TestCase::TestController

Inherits:
Object
  • Object
show all
Defined in:
lib/workarea/testing/locale_routing_fixes.rb,
lib/workarea/view_test.rb

Overview

This fix allows us to default locale to nil so routes in helper tests can be generated as expected. This is unbelievably shitty and makes me really sad. Details on this can be found here: github.com/rspec/rspec-rails/issues/255

Instance Method Summary collapse

Instance Method Details

#default_url_options(options = {}) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/workarea/testing/locale_routing_fixes.rb', line 8

def default_url_options(options={})
  if options.key?(:locale) || options.key?('locale')
    options
  else
    { locale: nil }.merge(options)
  end
end