Skip to content
Showing with 12 additions and 0 deletions.
  1. +2 −0 lib/paperclip/storage/s3.rb
  2. +10 −0 test/storage/s3_test.rb
View
2 lib/paperclip/storage/s3.rb
@@ -238,6 +238,8 @@ def exists?(style = default_style)
else
false
end
+ rescue AWS::Errors::Base => e
+ false
end
def s3_permissions(style = default_style)
View
10 test/storage/s3_test.rb
@@ -542,6 +542,16 @@ def counter
assert true
end
end
+
+ context 'that the file were missing' do
+ setup do
+ AWS::S3::S3Object.any_instance.stubs(:exists?).raises(AWS::Errors::Base)
+ end
+
+ should 'return false on exists?' do
+ assert !@dummy.avatar.exists?
+ end
+ end
end
end

0 comments on commit 56012bf

Please sign in to comment.
Something went wrong with that request. Please try again.