From 0284f8544c4d0dbb260da21517ea6326f9f2ab2f Mon Sep 17 00:00:00 2001 From: Mitsuhiro Shibuya Date: Sun, 8 Jan 2023 19:12:31 +0900 Subject: [PATCH] Add spec to ensure #recreate_versions! doesn't break when file isn't stored The issue itself is already fixed by 28190e9. Closes #2186 --- spec/uploader/versions_spec.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/spec/uploader/versions_spec.rb b/spec/uploader/versions_spec.rb index 1c2842d3b..a1b12d99d 100644 --- a/spec/uploader/versions_spec.rb +++ b/spec/uploader/versions_spec.rb @@ -718,6 +718,13 @@ def upcase let(:thumb_contents) { File.read(public_path(@uploader.thumb.to_s)) } let(:small_thumb_contents) { File.read(public_path(@uploader.small_thumb.to_s)) } + context "when the file is not stored" do + it "should not break" do + @uploader.recreate_versions! + @uploader.recreate_versions!(:small_thumb) + end + end + context "when no versions are given" do it "should process file based on the version" do @uploader.store!(bork_file)