Merge pull request #2719 from javierv/2718-fix_flaky_milestone_spec

Fix flaky spec: Budget Investments Show milestones
This commit is contained in:
Raimond Garcia
2018-07-12 16:07:48 +02:00
committed by GitHub
4 changed files with 3 additions and 5 deletions

View File

@@ -59,6 +59,7 @@ class ApplicationController < ActionController::Base
end
I18n.locale = locale
Globalize.locale = I18n.locale
end
def set_layout

View File

@@ -2,7 +2,6 @@ module Translatable
extend ActiveSupport::Concern
included do
before_action :set_translation_locale
before_action :delete_translations, only: [:update]
end
@@ -12,10 +11,6 @@ module Translatable
resource_model.globalize_attribute_names.select { |k, v| params.include?(k.to_sym) && params[k].present? }
end
def set_translation_locale
Globalize.locale = I18n.locale
end
def delete_translations
locales = resource_model.globalize_locales.
select { |k, v| params[:delete_translations].include?(k.to_sym) && params[:delete_translations][k] == "1" }

View File

@@ -39,6 +39,7 @@ class Management::BaseController < ActionController::Base
session[:locale] ||= I18n.default_locale
I18n.locale = session[:locale]
Globalize.locale = I18n.locale
end
def current_budget

View File

@@ -42,6 +42,7 @@ RSpec.configure do |config|
config.before do |example|
DatabaseCleaner.strategy = :transaction
I18n.locale = :en
Globalize.locale = I18n.locale
load Rails.root.join('db', 'seeds.rb').to_s
Setting["feature.user.skip_verification"] = nil
end