Tuesday, 3 September 2013

Speed up image processing of Paperclip in Acceptance Tests

Speed up image processing of Paperclip in Acceptance Tests

When running capybara feature specs I can see lots of Slow factory notices
which are populated by factory_girl. These Slow factory things heavy slow
down the feature specs, I think, even feature specs are intrinsic slow
specs. Then I had some inspect and found out most of the Slow factory was
caused by paperclip. We had model using paperclip here:
FactoryGirl.define do
factory :asset do
image Rails.root.join('spec/fixtures/sample.jpg').open
end
end
So I wonder if there's a way like test mode for paperclip to speed up
tests. I have simple solution here: Just copy the original file instead of
actually crop it.

No comments:

Post a Comment