Sha256: 956c6ef84bd018b392dbd981e57eaab250ef34c4914a6d47f94ea5665b842b55
Contents?: true
Size: 983 Bytes
Versions: 11
Compression:
Stored size: 983 Bytes
Contents
require 'rails_helper' module MnoEnterprise describe 'ApplicationController I18n', type: :controller do # Anonymous controller controller do include MnoEnterprise::Concerns::Controllers::I18n def index render text: 'Hello World' end end describe 'I18n' do before do I18n.available_locales = [:en, :fr] I18n.default_locale = :en end context 'when a valid locale is provided' do it 'sets the provided locale' do get :index, locale: :fr expect(I18n.locale).to eq(:fr) end end context 'when an invalid locale is provided' do it 'sets the default locale' do get :index, locale: :it expect(I18n.locale).to eq(:en) end end context 'when the locale is not provided' do it 'sets the default locale' do get :index expect(I18n.locale).to eq(:en) end end end end end
Version data entries
11 entries across 11 versions & 1 rubygems