Skip to content
Browse files

Revert "Revert "Cleanup from merge, update history""

This reverts commit 0fbecf0.

Sorry for the confusion - I shouldn't have reverted this in the first place.
  • Loading branch information...
1 parent a031b95 commit 642b7dc37ab2e447ea0f22a80153947f7f916040 @trevorturk trevorturk committed Jan 30, 2011
Showing with 24 additions and 8 deletions.
  1. +1 −0 History.txt
  2. +23 −8 spec/storage/s3_spec.rb
View
1 History.txt
@@ -7,6 +7,7 @@
* [added] CarrierWave::SanitizedFile#sanitize_regexp public method to allow customizing [trevorturk]
* [added] Ability to use https for Amazon S3 URLs if config.s3_use_ssl is true [recruitmilitary]
* [added] The s3_region configuration documentation to the README [mrsimo]
+* [fixed] Reprocessing remotely stored files [alexcrichton]
* [fixed] Nested versioning processing [alexcrichton]
* [fixed] An intermittent bug with ImageScience resize_to_fill method [LupineDev]
* [fixed] DataMapper#save should remove the avatar if remove_avatar? returns true [wprater]
View
31 spec/storage/s3_spec.rb
@@ -199,18 +199,21 @@ def stub_s3_access mock
end
end
- describe "processing versions" do
- before :each do
+ describe "recreate_versions!" do
+ before do
@uploader_class = Class.new(CarrierWave::Uploader::Base)
@uploader_class.class_eval{
include CarrierWave::MiniMagick
storage :s3
- process :convert => 'png'
+ process :resize_to_fit => [30, 30]
+
version :foo do
- process :resize_to_fit => [200, 200]
+ process :resize_to_fit => [20, 20]
- version :bar
+ version :bar do
+ process :resize_to_fit => [10, 10]
+ end
end
}
@@ -219,15 +222,27 @@ def stub_s3_access mock
stub_s3_access @versioned.foo
stub_s3_access @versioned.foo.bar
+ @paths = ['portrait.jpg', 'foo_portrait.jpg', 'foo_bar_portrait.jpg']
+
@versioned.store! File.open(file_path('portrait.jpg'))
end
after do
- FileUtils.rm_rf public_path
+ FileUtils.rm_rf(public_path)
+
+ @paths.each do |path|
+ @storage.connection.delete_object(@bucket, "uploads/#{path}")
+ end
end
- it "should reprocess versions without exception" do
- running{ @versioned.recreate_versions! }.should_not raise_error
+ it "should recreate versions without exception" do
+ lambda do
+ @versioned.recreate_versions!
+
+ @paths.each do |path|
+ @storage.connection.head_object(@bucket, "uploads/#{path}").status.should == 200
+ end
+ end.should_not raise_error
end
end

0 comments on commit 642b7dc

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