From 6037c17cd44107b4f63cf291018764fa175e029c Mon Sep 17 00:00:00 2001 From: Lin Jen-Shin Date: Thu, 21 Jun 2018 21:39:28 +0800 Subject: Bring this test from EE --- spec/uploaders/object_storage_spec.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spec/uploaders/object_storage_spec.rb b/spec/uploaders/object_storage_spec.rb index c7f5694ff43..7e673681c31 100644 --- a/spec/uploaders/object_storage_spec.rb +++ b/spec/uploaders/object_storage_spec.rb @@ -191,6 +191,18 @@ describe ObjectStorage do 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 -- cgit v1.2.1