1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2024-08-20 21:08:15 -07:00

Add have_http_header rspec matcher

This commit is contained in:
Matt Jankowski 2024-07-11 09:30:48 -04:00
parent ac1baabff2
commit 5973e20fb0

View file

@ -0,0 +1,11 @@
# frozen_string_literal: true
RSpec::Matchers.define :have_http_header do |header, values|
match do |response|
response.headers[header].match?(values)
end
failure_message do |response|
"Expected that `#{header}` would have values of `#{values}` but was `#{response.headers[header]}`"
end
end