summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2018-06-21 21:39:28 +0800
committerLin Jen-Shin <godfat@godfat.org>2018-06-21 21:39:28 +0800
commit6037c17cd44107b4f63cf291018764fa175e029c (patch)
tree4452ffb669577476a801814be68588468f4960a8
parent14e35ac9b19d358d84e0cfd167f74036937285b6 (diff)
downloadgitlab-ce-unify-object_storage_spec.rb.tar.gz
Bring this test from EEunify-object_storage_spec.rb
-rw-r--r--spec/uploaders/object_storage_spec.rb12
1 files changed, 12 insertions, 0 deletions
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