Replace harcoded images and documents settings
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user