top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration
Print Preview

How to Speed up image processing of Paperclip in Acceptance Tests

+1 vote
73 views

When running capybara feature specs I can see lots of Slow factory notices which are populated byfactory_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 bypaperclip. 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.

posted Sep 4, 2013 by Ahmed Patel

Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

1 Answer

+1 vote

How many times do you test the same paths with this? Maybe judicious use of before(:all) for some tests might speed things up as well? Another though (not really knowing if this makes sense) — if your image is 1x1 pixels does it do anything? You really should not need to test the actual image rendering bits more than once or twice in your whole suite.

answer Sep 5, 2013 by Dewang Chaudhary
Similar Questions
+1 vote

I am trying to compress the original image stored by paperclip using smusher on my local machine but I am getting this (getaddrinfo: Name or service not known (ypoweb-01.experf.gq1.yahoo.com:80).
I want to know the proper way of how to compress the paperclip original images using smusher or punypng or is there any other way to compress those images.

+2 votes

Right now i am working on rails 3 . Is there any possible way to increase the css and js file loading speed (with out asset). please help me

0 votes

What is the best method to manage image uploads in Rails? Is there a tool that allows auto-resizing upon image upload based on predefined dimensions? Moreover, is there any tool available that makes it possible to render / regenerate the same originally uploaded image using alternative view based styles, e.g. thumbs, 320x200 or 640x480 etc..?

0 votes

I need to upload multiple image upload at a time in my application. I searched and got the carrierwave gem as a solution, but I find that only one image at a time.but i need to upload multiple images at a time using single the button uploadimage. How can I overcome this problem.

+2 votes

Which is the most efficient (i.e. processing speed) way to create a server application that accesses a database: A Servlet using JDBC; a JSP page using a JavaBean to carry out the db access; or JSP combined with a Servlet? Are these my only choices?


Useful Links with Similar Problem
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...