mirror of
https://github.com/glitch-soc/mastodon.git
synced 2026-03-29 03:00:33 +02:00
18 lines
460 B
Ruby
18 lines
460 B
Ruby
# frozen_string_literal: true
|
|
|
|
RSpec::Matchers.define :have_attachment do |value|
|
|
match do |response|
|
|
expect(response.headers['Content-Disposition'])
|
|
.to match(<<~FILENAME.squish)
|
|
attachment; filename="#{value}"
|
|
FILENAME
|
|
end
|
|
|
|
failure_message do |response|
|
|
<<~ERROR
|
|
Expected response to have file attachment of `#{value}` but was:
|
|
Content-Disposition: #{response.headers['Content-Disposition']}
|
|
ERROR
|
|
end
|
|
end
|