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:
parent
ac1baabff2
commit
5973e20fb0
1 changed files with 11 additions and 0 deletions
11
spec/support/matchers/http_headers.rb
Normal file
11
spec/support/matchers/http_headers.rb
Normal 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
|
Loading…
Reference in a new issue