Permalink
Browse files

Fixed error in S3 deleting

  • Loading branch information...
Jon Yurek
Jon Yurek committed Aug 13, 2008
1 parent f4a11e1 commit 978b1e9801a02f90e0576501ff7dab98ed7e4249
Showing with 18 additions and 1 deletion.
  1. +1 −1 lib/paperclip/storage.rb
  2. +17 −0 test/storage_test.rb
View
@@ -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
View
@@ -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

0 comments on commit 978b1e9

Please sign in to comment.