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 2224f22b4d
commit 4b4da73dc6

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