Loading ee/app/uploaders/object_storage.rb +1 −0 Original line number Diff line number Diff line Loading @@ -241,6 +241,7 @@ def use_file cache_stored_file! yield cache_path ensure FileUtils.rm_f(cache_path) cache_storage.delete_dir!(cache_path(nil)) end end Loading ee/spec/uploaders/object_storage_spec.rb +12 −0 Original line number Diff line number Diff line Loading @@ -189,6 +189,18 @@ def dynamic_segment it "calls a cache path" do expect { |b| uploader.use_file(&b) }.to yield_with_args(%r[tmp/cache]) end it "cleans up the cached file" do cached_path = '' uploader.use_file do |path| cached_path = path expect(File.exist?(cached_path)).to be_truthy end expect(File.exist?(cached_path)).to be_falsey end end end Loading Loading
ee/app/uploaders/object_storage.rb +1 −0 Original line number Diff line number Diff line Loading @@ -241,6 +241,7 @@ def use_file cache_stored_file! yield cache_path ensure FileUtils.rm_f(cache_path) cache_storage.delete_dir!(cache_path(nil)) end end Loading
ee/spec/uploaders/object_storage_spec.rb +12 −0 Original line number Diff line number Diff line Loading @@ -189,6 +189,18 @@ def dynamic_segment it "calls a cache path" do expect { |b| uploader.use_file(&b) }.to yield_with_args(%r[tmp/cache]) end it "cleans up the cached file" do cached_path = '' uploader.use_file do |path| cached_path = path expect(File.exist?(cached_path)).to be_truthy end expect(File.exist?(cached_path)).to be_falsey end end end Loading