3
我的應用程序做了很多與圖像。我用回形針將它們附加到模型上。我有大量的測試(測試::單元),涉及到創建圖像,這些運行非常緩慢。如何加快涉及圖片上傳/調整大小的Rails單元測試?
我使用FactoryGirl在我的測試中創建模型。這是我如何創建圖像附件:
factory :product_image_100_100 do
image File.new(File.join(::Rails.root.to_s, "/test/fixtures/images", "100_100.jpg"))
end
我該如何僞造圖像上傳或以其他方式加快速度?