Commit ef1148656a61028e5c8cbb939a8f368690f04957

Authored by Diego Camarinha
Committed by Rafael Manzo
1 parent 75e952c4

Resolving conflict on application.rb

config/application.rb
... ... @@ -18,7 +18,8 @@ module Mezuro
18 18  
19 19 # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
20 20 config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '**', '*.{rb,yml}').to_s]
21   - config.i18n.default_locale = :en
  21 + # config.i18n.default_locale = :de
  22 + config.available_locales = ['en', 'pt-BR']
22 23 config.i18n.enforce_available_locales = true
23 24  
24 25 # Do not swallow errors in after_commit/after_rollback callbacks.
... ...
spec/controllers/home_controller_spec.rb
... ... @@ -18,7 +18,7 @@ describe HomeController, :type => :controller do
18 18 it 'should automatically use the language specified in the request headers' do
19 19 request.env['HTTP_ACCEPT_LANGUAGE'] = 'pt-BR'
20 20 get :index
21   - expect(I18n.locale).to eq(:pt)
  21 + expect(I18n.locale).to eq(:"pt-BR")
22 22 end
23 23  
24 24 it 'should use a different region if still the best match' do
... ... @@ -28,7 +28,7 @@ describe HomeController, :type => :controller do
28 28 end
29 29  
30 30 it 'should use the default language if no available language matches the requested one' do
31   - request.env['HTTP_ACCEPT_LANGUAGE'] = 'de'
  31 + request.env['HTTP_ACCEPT_LANGUAGE'] = 'la'
32 32 get :index
33 33 expect(I18n.locale).to eq(:en)
34 34 end
... ...