Files
openproject/spec/support/request_with_header.rb
T
Jan Sandbrink 0b87e7543f Freeze string literals in specs
Rolling out frozen string literals further by freezing all
string literals in core specs.
2025-05-05 09:29:55 +02:00

16 lines
418 B
Ruby

# frozen_string_literal: true
RSpec.configure do |c|
##
# Session-based API authentication requires the X-requested-with header to be present.
c.before(:each, type: :request) do |ex|
unless ex.metadata[:skip_xhr_header]
header("X-Requested-With", "XMLHttpRequest")
end
end
c.before(:each, content_type: :json, type: :request) do |_ex|
header("Content-Type", "application/json")
end
end