From 836c0477ac63ea61b955bfb900cf52ec29554e40 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Thu, 27 Jun 2024 12:03:26 -0400 Subject: [PATCH] Use vips setting instead of env var in media processing spec (#30859) --- spec/models/media_attachment_spec.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/spec/models/media_attachment_spec.rb b/spec/models/media_attachment_spec.rb index 221645ac5a..a8f1ce7745 100644 --- a/spec/models/media_attachment_spec.rb +++ b/spec/models/media_attachment_spec.rb @@ -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.thumbnail.present?).to be true - # NOTE: Our libvips and ImageMagick implementations currently have different results - expect(media.file.meta['colors']['background']).to eq(ENV['MASTODON_USE_LIBVIPS'] ? '#268cd9' : '#3088d4') + expect(media.file.meta['colors']['background']).to eq(expected_background_color) expect(media.file_file_name).to_not eq 'boop.ogg' end + + def expected_background_color + # The libvips and ImageMagick implementations produce different results + Rails.configuration.x.use_vips ? '#268cd9' : '#3088d4' + end end describe 'mp3 with large cover art' do