From 4f798fc5d87c40c5d56b1252132daee359081e1f Mon Sep 17 00:00:00 2001 From: Benjamin Neff Date: Mon, 13 Nov 2023 00:55:48 +0100 Subject: [PATCH] Ensure image processing gets disabled again, even after exceptions Otherwise this leaves it enabled if the processing failed, which then makes other specs fail where they expect the image not being processed (for example still have the initial set dimensions, instead of the one read from image after processing). --- spec/models/photo_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/models/photo_spec.rb b/spec/models/photo_spec.rb index 375a9efd760..3f59699be39 100644 --- a/spec/models/photo_spec.rb +++ b/spec/models/photo_spec.rb @@ -6,9 +6,9 @@ def with_carrierwave_processing(&block) UnprocessedImage.enable_processing = true - val = yield + yield +ensure UnprocessedImage.enable_processing = false - val end describe Photo, :type => :model do