Skip to content

Instantly share code, notes, and snippets.

@cgunther
Created May 20, 2011 13:19
Show Gist options
  • Save cgunther/982869 to your computer and use it in GitHub Desktop.
Save cgunther/982869 to your computer and use it in GitHub Desktop.
Paperclip stubbing
module Paperclip
# We don't need to be testing that thumbnails are created
class Attachment
private
def post_process_styles
true
end
end
class Geometry
def self.from_file file
parse("100x100")
end
end
# Overwrite #flush_writes so we don't actually reach out to S3
module Storage
module S3
def flush_writes
@queued_for_write.each { |style, file| file.close }
@queued_for_write = {}
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment