From 7361b2da0b2412b0113199630cd543a8a91c1a36 Mon Sep 17 00:00:00 2001 From: Maikel Linke Date: Tue, 20 Jan 2026 16:29:53 +1100 Subject: [PATCH] Move related rspec config to one place --- spec/base_spec_helper.rb | 3 +++ spec/spec_helper.rb | 5 ----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/spec/base_spec_helper.rb b/spec/base_spec_helper.rb index 4f06f874b0..2078c0a3ca 100644 --- a/spec/base_spec_helper.rb +++ b/spec/base_spec_helper.rb @@ -156,6 +156,9 @@ RSpec.configure do |config| I18n.with_locale(locale) { example.run } end + # Fix encoding issue in Rails 5.0; allows passing empty arrays or hashes as params. + config.before(:each, type: :controller) { @request.env["CONTENT_TYPE"] = 'application/json' } + # Reset all feature toggles to prevent leaking. config.before(:each) do Flipper.features.each(&:remove) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 3ec6ea3cf2..7cbb05ea10 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,8 +1,3 @@ # frozen_string_literal: true require 'base_spec_helper' - -RSpec.configure do |config| - # Fix encoding issue in Rails 5.0; allows passing empty arrays or hashes as params. - config.before(:each, type: :controller) { @request.env["CONTENT_TYPE"] = 'application/json' } -end