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