diff --git a/app/models/preview_card.rb b/app/models/preview_card.rb index 5a11351e58..7579178f83 100644 --- a/app/models/preview_card.rb +++ b/app/models/preview_card.rb @@ -39,7 +39,7 @@ class PreviewCard < ApplicationRecord include Attachmentable IMAGE_MIME_TYPES = ['image/jpeg', 'image/png', 'image/gif', 'image/webp'].freeze - LIMIT = 2.megabytes + LIMIT = Rails.configuration.x.use_vips ? 8.megabytes : 2.megabytes BLURHASH_OPTIONS = { x_comp: 4, diff --git a/spec/models/preview_card_spec.rb b/spec/models/preview_card_spec.rb index 2f0ea38ee4..c0bc2b6e0e 100644 --- a/spec/models/preview_card_spec.rb +++ b/spec/models/preview_card_spec.rb @@ -3,6 +3,12 @@ require 'rails_helper' RSpec.describe PreviewCard do + describe 'file size limit', :attachment_processing do + it 'is set differently whether vips is enabled or not' do + expect(described_class::LIMIT).to eq(Rails.configuration.x.use_vips ? 8.megabytes : 2.megabytes) + end + end + describe 'validations' do describe 'urls' do it 'allows http schemes' do