Use vips setting instead of env var in media processing spec (#30859)

This commit is contained in:
Matt Jankowski 2024-06-27 12:03:26 -04:00 committed by GitHub
parent b15a3614dc
commit 836c0477ac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -210,10 +210,14 @@ RSpec.describe MediaAttachment, :paperclip_processing do
expect(media.file.meta['original']['duration']).to be_within(0.05).of(0.235102) expect(media.file.meta['original']['duration']).to be_within(0.05).of(0.235102)
expect(media.thumbnail.present?).to be true expect(media.thumbnail.present?).to be true
# NOTE: Our libvips and ImageMagick implementations currently have different results expect(media.file.meta['colors']['background']).to eq(expected_background_color)
expect(media.file.meta['colors']['background']).to eq(ENV['MASTODON_USE_LIBVIPS'] ? '#268cd9' : '#3088d4')
expect(media.file_file_name).to_not eq 'boop.ogg' expect(media.file_file_name).to_not eq 'boop.ogg'
end end
def expected_background_color
# The libvips and ImageMagick implementations produce different results
Rails.configuration.x.use_vips ? '#268cd9' : '#3088d4'
end
end end
describe 'mp3 with large cover art' do describe 'mp3 with large cover art' do