I have a rails 3.2 app with paperclip 3.2 and I have a model that has a required paperclip attachment(thumb). How can I create valid objects without having the file saved to the filesystem or S3. What I currently have is below but this saves to the filesystem on each run. Is there a way to have a valid episode without uploading everytime?
Model:
class Episode
include Mongoid::Document
include Mongoid::Paperclip
has_mongoid_attached_file :thumb
validates_attachment_presence :thumb
end
Spec:
require 'spec_helper'
describe Episode do
it "has a valid factory" do
Fabricate.build(:episode).should be_valid
end
end
Fabricator:
Fabricator(:episode) do
thumb { File.open(File.join(Rails.root, 'spec', 'fabricators', 'assets', 'thumb.jpg'))}
end