Replace harcoded images and documents settings

This commit is contained in:
Julian Herrero
2019-05-16 17:42:17 +02:00
parent 220bfb065a
commit 8e0bbf54f6
15 changed files with 77 additions and 60 deletions

View File

@@ -41,7 +41,8 @@ shared_examples "image validations" do |imageable_factory|
end
it "is not valid for attachments larger than imageable max_file_size definition" do
allow(image).to receive(:attachment_file_size).and_return(Image::MAX_IMAGE_SIZE + 1.byte)
larger_size = Setting["uploads.images.max_size"].to_i.megabytes + 1.byte
allow(image).to receive(:attachment_file_size).and_return(larger_size)
expect(image).not_to be_valid
expect(image.errors[:attachment]).to include "must be in between 0 Bytes and 1 MB"
@@ -67,4 +68,4 @@ shared_examples "image validations" do |imageable_factory|
expect(image).not_to be_valid
end
end
end