Commit 7a38ef79 by Jon Yurek

Merge remote branch 'tilsammans/master'

parents 208883dc 88a65aaf
......@@ -15,7 +15,7 @@ useful defaults.
See the documentation for +has_attached_file+ in Paperclip::ClassMethods for
more detailed options.
The complete RDoc[http://rdoc.info/projects/thoughtbot/paperclip] is online.
The complete RDoc[http://rdoc.info/gems/paperclip] is online.
==Installation
......@@ -23,6 +23,12 @@ Include the gem in your Gemfile:
gem "paperclip", "~> 2.3"
==Installation
As a plugin:
ruby script/plugin install git://github.com/thoughtbot/paperclip.git
==Quick Start
In your model:
......
......@@ -235,6 +235,9 @@ module Paperclip
else
true
end
rescue Errno::EACCES => e
warn "#{e} - skipping file"
false
end
# Returns true if a file has been assigned.
......
......@@ -35,6 +35,22 @@ class IntegrationTest < Test::Unit::TestCase
assert_match /\b50x50\b/, `identify "#{@dummy.avatar.path(:thumb)}"`
end
context 'reprocessing with unreadable original' do
setup { File.chmod(0000, @dummy.avatar.path) }
should "not raise an error" do
assert_nothing_raised do
@dummy.avatar.reprocess!
end
end
should "return false" do
assert ! @dummy.avatar.reprocess!
end
teardown { File.chmod(0644, @dummy.avatar.path) }
end
context "redefining its attachment styles" do
setup do
Dummy.class_eval do
......
......@@ -8,6 +8,29 @@ class StorageTest < Test::Unit::TestCase
end
end
context "filesystem" do
setup do
rebuild_model :styles => { :thumbnail => "25x25#" }
@dummy = Dummy.create!
@dummy.avatar = File.open(File.join(File.dirname(__FILE__), "fixtures", "5k.png"))
end
should "allow file assignment" do
assert @dummy.save
end
should "store the original" do
@dummy.save
assert File.exists?(@dummy.avatar.path)
end
should "store the thumbnail" do
@dummy.save
assert File.exists?(@dummy.avatar.path(:thumbnail))
end
end
context "Parsing S3 credentials" do
setup do
AWS::S3::Base.stubs(:establish_connection!)
......
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