Files
openfoodnetwork/spec/spec_helper.rb
David Cook f0110d20a2 Move config to base helper
This config is relevant for all specs, including system specs.
2023-04-18 09:50:08 +10:00

16 lines
533 B
Ruby

# frozen_string_literal: true
require 'base_spec_helper'
require 'database_cleaner'
RSpec.configure do |config|
# Precompile Webpacker assets (once) when starting the suite. The default setup can result
# in the assets getting compiled many times throughout the build, slowing it down.
config.before :suite do
Webpacker.compile
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' }
end