From 3f6893c6419c842f32dc0727db8d46dd8e457777 Mon Sep 17 00:00:00 2001 From: Yamagishi Kazutoshi Date: Sun, 22 Apr 2018 06:37:07 +0900 Subject: [PATCH] Reset locale on registration tests (#7219) --- spec/controllers/auth/registrations_controller_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/spec/controllers/auth/registrations_controller_spec.rb b/spec/controllers/auth/registrations_controller_spec.rb index 9cfbd481f8..eeb01d5ada 100644 --- a/spec/controllers/auth/registrations_controller_spec.rb +++ b/spec/controllers/auth/registrations_controller_spec.rb @@ -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