OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openproject/spec/support/request_with_header.rb

14 lines
387 B

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, type: :request, content_type: :json) do |_ex|
header('Content-Type', 'application/json')
end
end