Commit 978b1e98 by Jon Yurek

Fixed error in S3 deleting

parent f4a11e1c
...@@ -158,7 +158,7 @@ module Paperclip ...@@ -158,7 +158,7 @@ module Paperclip
logger.info("[paperclip] Writing files for #{name}") logger.info("[paperclip] Writing files for #{name}")
@queued_for_delete.each do |path| @queued_for_delete.each do |path|
begin begin
logger.info("[paperclip] -> #{path(style)}") logger.info("[paperclip] -> #{path}")
if file = s3_bucket.key(path) if file = s3_bucket.key(path)
file.delete file.delete
end end
......
...@@ -91,6 +91,23 @@ class StorageTest < Test::Unit::TestCase ...@@ -91,6 +91,23 @@ class StorageTest < Test::Unit::TestCase
assert true assert true
end end
end end
context "and remove" do
setup do
@s3_mock = stub
@bucket_mock = stub
RightAws::S3.expects(:new).with("12345", "54321", {}).returns(@s3_mock)
@s3_mock.expects(:bucket).with("testing", true, "public-read").returns(@bucket_mock)
@key_mock = stub
@bucket_mock.expects(:key).at_least(2).returns(@key_mock)
@key_mock.expects(:delete)
@dummy.destroy_attached_files
end
should "succeed" do
assert true
end
end
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment