Skip to content

Commit

Permalink
Fixed error in S3 deleting
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Yurek committed Aug 13, 2008
1 parent f4a11e1 commit 978b1e9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/paperclip/storage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def flush_deletes #:nodoc:
logger.info("[paperclip] Writing files for #{name}")
@queued_for_delete.each do |path|
begin
logger.info("[paperclip] -> #{path(style)}")
logger.info("[paperclip] -> #{path}")
if file = s3_bucket.key(path)
file.delete
end
Expand Down
17 changes: 17 additions & 0 deletions test/storage_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,23 @@ class StorageTest < Test::Unit::TestCase
assert true
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

Expand Down

0 comments on commit 978b1e9

Please sign in to comment.