Reset locale on registration tests (#7219)

lolsob-rspec
Yamagishi Kazutoshi 2018-04-22 06:37:07 +09:00 committed by Eugen Rochko
parent 308be04040
commit 3637c4983b
1 changed files with 6 additions and 0 deletions

View File

@ -73,6 +73,12 @@ RSpec.describe Auth::RegistrationsController, type: :controller do
describe 'POST #create' do
let(:accept_language) { Rails.application.config.i18n.available_locales.sample.to_s }
around do |example|
current_locale = I18n.locale
example.run
I18n.locale = current_locale
end
before { request.env["devise.mapping"] = Devise.mappings[:user] }
context do