我有carrierwave設置,它處理我的圖像很好。我在子文件夾中獲得了很好的調整大小的拇指版本。無論是從我的前端(HTML)和我的rails console
。我使用MiniMagicrspec載波應該have_dimensions總是失敗:拇指不調整
但在我的rspec拇指測試總是失敗。
describe 'processed images' do
before(:each) do
AttachmentUploader.enable_processing = true
AttachmentUploader.enable_processing = true
@uploader = AttachmentUploader.new(@post, :image)
@uploader.store!(File.open(@file))
end
after(:each) do
@uploader.remove!
AttachmentUploader.enable_processing = false
end
describe 'the thumb version' do
it "should scale down ane image to be exactly 50 by 50 pixels" do
@uploader.recreate_versions!
@uploader.thumb.should have_dimensions(50, 50)
end
end
@file
是在燈具中找到的文件。它被發現並附加(其他測試通過)。如果我註釋掉@uploader.remove!
這行,它會在例如.../public/uploads/post/image/thumb_fig.png
。 然而,該文件是而不是調整大小。當調用相同的序列槽rails console
時,它會調整大小。
我是否在我的規格中丟失了某些東西?我需要設置特殊標誌嗎?強制某種方法被運行?