Displaying 1 result from an estimated 1 matches for "car_spec".
Did you mean:
caf_spec
2014 Feb 18
0
How to Test Multimodel Paperclip attachments?
...file :upload, styles: { medium: '300x300>', thumb:
'100x100>' }
validates_attachment_content_type :upload, content_type:
/\Aimage\/.*\Z/
validates_attachment_presence :upload
end
As you can see there is a has_many and belongs_to relationship between
the two.
car_spec.rb
require 'spec_helper'
describe Car do
before do
@car = Car.new(FactoryGirl.attributes_for(:car))
end
subject { @car }
it { should respond_to(:uploads) }
it { should be_valid }
end
cars.rb factory
FactoryGirl.define do
fac...