Sha256: ba53818f1ead5d089256957453caab6737ab8891231a755c64ac4fba018c68d1
Contents?: true
Size: 848 Bytes
Versions: 15
Compression:
Stored size: 848 Bytes
Contents
require './test/helper' class ValidatorsTest < Test::Unit::TestCase def setup rebuild_model end context "using the helper" do setup do Dummy.validates_attachment :avatar, :presence => true, :content_type => { :content_type => "image/jpg" }, :size => { :in => 0..10.kilobytes } end should "add the attachment_presence validator to the class" do assert Dummy.validators_on(:avatar).any?{ |validator| validator.kind == :attachment_presence } end should "add the attachment_content_type validator to the class" do assert Dummy.validators_on(:avatar).any?{ |validator| validator.kind == :attachment_content_type } end should "add the attachment_size validator to the class" do assert Dummy.validators_on(:avatar).any?{ |validator| validator.kind == :attachment_size } end end end
Version data entries
15 entries across 15 versions & 2 rubygems