Fix tests for latest locale change
This commit is contained in:
@ -43,14 +43,14 @@ describe ApplicationController do
|
||||
|
||||
context "when using the 'custom_locale' parameter" do
|
||||
it 'overwrites the session' do
|
||||
expect(session).to receive(:[]=).with(:locale, locale.to_s)
|
||||
expect(session).to receive(:[]=).with(:locale, locale)
|
||||
get :welcome, params: {custom_locale: locale}
|
||||
end
|
||||
end
|
||||
|
||||
context "when using the 'locale' parameter" do
|
||||
it 'overwrites the session' do
|
||||
expect(session).to receive(:[]=).with(:locale, locale.to_s)
|
||||
expect(session).to receive(:[]=).with(:locale, locale)
|
||||
get :welcome, params: {locale: locale}
|
||||
end
|
||||
end
|
||||
|
@ -86,9 +86,9 @@ describe SessionsController do
|
||||
|
||||
it 'sets the specified locale' do
|
||||
expect(controller).to receive(:switch_locale).and_call_original
|
||||
i18n = class_double I18n, locale: locale.to_s
|
||||
i18n = class_double I18n, locale: locale
|
||||
allow(I18n).to receive(:locale=).with(I18n.default_locale).and_call_original
|
||||
allow(I18n).to receive(:locale=).with(locale.to_s).and_return(i18n)
|
||||
allow(I18n).to receive(:locale=).with(locale).and_return(i18n)
|
||||
perform_request
|
||||
expect(i18n.locale.to_sym).to eq(locale)
|
||||
end
|
||||
|
Reference in New Issue
Block a user