validates_attachment_presence usage? not working

5 views
Skip to first unread message

CED

unread,
Oct 1, 2008, 3:08:15 PM10/1/08
to Paperclip Plugin
I have a model with validates_attachment_presence on the attached
file. validates_attachment_presence is being called I have verified
that. The model always passes validation even if i don't check the
asset field explicitly.


Maybe I am doing this wrong, but here is the spec that fails

it "should not be valid without an asset" do
@asset.attributes = valid_attributes.except(:asset)
@asset.valid?
@asset.should have(1).error_on(:asset)
end

valid_attributes = {:name => "AssetOne", :asset => @file}
Reply all
Reply to author
Forward
0 new messages