Displaying 1 result from an estimated 1 matches for "validate_attachment_presence".
Did you mean:
validates_attachment_presence
2012 Jan 19
0
Problem in testing with separate validation of :attachment_file_name
...Example Model
class Example < ActiveRecord::Base
has_attached_file :attachment
validates_attachment_presence :attachment
validates_format_of :attachment_file_name, :with => /\.(png|jpe?g)$/
end
Example Test
require ''spec/helper''
describe Example do
it { should validate_attachment_presence(:attachment) }
it { should validate_format_of(:attachment_file_name).
with(''example.png'') }
it { should validate_format_of(:attachment_file_name).
not_with(''example.zip'').
with_message(/is invalid/) }
end
This causes my valida...