Skip to content

Commit

Permalink
Ensure image processing gets disabled again, even after exceptions
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
SuperTux88 committed Nov 13, 2023
1 parent bb882da commit 4f798fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spec/models/photo_spec.rb
Expand Up @@ -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
Expand Down

0 comments on commit 4f798fc

Please sign in to comment.