Sha256: 304fbef95d800af918ba964b4713c78e639b52b4cb66b7494493e33d0c891340
Contents?: true
Size: 976 Bytes
Versions: 9
Compression:
Stored size: 976 Bytes
Contents
require 'rails_helper' module MnoEnterprise describe ApplicationController, 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
9 entries across 9 versions & 1 rubygems