Move related rspec config to one place

This commit is contained in:
Maikel Linke
2026-01-20 16:29:53 +11:00
parent 3ebacbc31a
commit 7361b2da0b
2 changed files with 3 additions and 5 deletions

View File

@@ -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)

View File

@@ -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