2013-10-16 81 views

回答

0

如果你想只是为了测试上传逻辑相关的东西,你的测试套件并不包括制造很多对象的带附件,你可以这样做:

Fabricator(:fabricator_name) do 
    image { File.open(File.join(Rails.root, 'spec', 'fabricators', 'assets', 'image.jpg'))} 
end 

和地点的任何小的图像命名的图像。 JPG格式/制造商/资产/文件夹。如注意到的here