From 8891091ebb88aa2bcef6bf16acfcd0dc18c72a37 Mon Sep 17 00:00:00 2001 From: filipefurtad0 Date: Wed, 20 Dec 2023 11:09:47 +0000 Subject: [PATCH] Uncomments preferences Moves I18n exception handler within base spec helper --- app/models/content_configuration.rb | 36 ++++++++++++++--------------- spec/base_spec_helper.rb | 10 ++++---- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/app/models/content_configuration.rb b/app/models/content_configuration.rb index bdd4b4abf1..8e031dcb57 100644 --- a/app/models/content_configuration.rb +++ b/app/models/content_configuration.rb @@ -24,28 +24,28 @@ class ContentConfiguration < Spree::Preferences::Configuration # All the following defaults using I18n don't work. # https://github.com/openfoodfoundation/openfoodnetwork/issues/3816 # default values for these fields are commented out below - preference :producer_signup_pricing_table_html, :text - # default: I18n.t(:content_configuration_pricing_table) - preference :producer_signup_case_studies_html, :text - # default: I18n.t(:content_configuration_case_studies) - preference :producer_signup_detail_html, :text - # default: I18n.t(:content_configuration_detail) + preference :producer_signup_pricing_table_html, :text, + default: I18n.t(:content_configuration_pricing_table) + preference :producer_signup_case_studies_html, :text, + default: I18n.t(:content_configuration_case_studies) + preference :producer_signup_detail_html, :text, + default: I18n.t(:content_configuration_detail) # Hubs sign-up page - preference :hub_signup_pricing_table_html, :text - # default: I18n.t(:content_configuration_pricing_table) - preference :hub_signup_case_studies_html, :text - # default: I18n.t(:content_configuration_case_studies) - preference :hub_signup_detail_html, :text - # default: I18n.t(:content_configuration_detail) + preference :hub_signup_pricing_table_html, :text, + default: I18n.t(:content_configuration_pricing_table) + preference :hub_signup_case_studies_html, :text, + default: I18n.t(:content_configuration_case_studies) + preference :hub_signup_detail_html, :text, + default: I18n.t(:content_configuration_detail) # Groups sign-up page - preference :group_signup_pricing_table_html, :text - # default: I18n.t(:content_configuration_pricing_table) - preference :group_signup_case_studies_html, :text - # default: I18n.t(:content_configuration_case_studies) - preference :group_signup_detail_html, :text - # default: I18n.t(:content_configuration_detail) + preference :group_signup_pricing_table_html, :text, + default: I18n.t(:content_configuration_pricing_table) + preference :group_signup_case_studies_html, :text, + default: I18n.t(:content_configuration_case_studies) + preference :group_signup_detail_html, :text, + default: I18n.t(:content_configuration_detail) # Main URLs preference :menu_1, :boolean, default: true diff --git a/spec/base_spec_helper.rb b/spec/base_spec_helper.rb index 4368c65a43..2d1eeed0da 100644 --- a/spec/base_spec_helper.rb +++ b/spec/base_spec_helper.rb @@ -50,6 +50,11 @@ end FactoryBot.use_parent_strategy = false FactoryBot::SyntaxRunner.include FileHelper +# raise I18n exception handler +I18n.exception_handler = proc do |exception, *_| + raise exception.to_exception +end + RSpec.configure do |config| # Remove this line if you're not using ActiveRecord or ActiveRecord fixtures config.fixture_path = "#{Rails.root.join('spec/fixtures')}" @@ -205,11 +210,6 @@ RSpec.configure do |config| # You can use `rspec -n` to run only failed specs. config.example_status_persistence_file_path = "tmp/rspec-status.txt" - # raise I18n exception handler - I18n.exception_handler = proc do |exception, *_| - raise exception.to_exception - end - # Helpers config.include FactoryBot::Syntax::Methods config.include JsonSpec::Helpers