Sha256: 6aba277eb08e1ff6c04df5845d6644c5f2f8c3aa25f07b03e77597b791f552cc

Contents?: true

Size: 677 Bytes

Versions: 19

Compression:

Stored size: 677 Bytes

Contents

require 'test/helper'

class ValidateAttachmentPresenceMatcherTest < Test::Unit::TestCase
  context "validate_attachment_presence" do
    setup do
      reset_table("dummies") do |d|
        d.string :avatar_file_name
      end
      @dummy_class = reset_class "Dummy"
      @dummy_class.has_attached_file :avatar
      @matcher     = self.class.validate_attachment_presence(:avatar)
    end

    context "given a class with no validation" do
      should_reject_dummy_class
    end

    context "given a class with a matching validation" do
      setup do
        @dummy_class.validates_attachment_presence :avatar
      end

      should_accept_dummy_class
    end
  end
end

Version data entries

19 entries across 19 versions & 9 rubygems

Version Path
olek-paperclip-2.3.3.2 test/matchers/validate_attachment_presence_matcher_test.rb
olek-paperclip-2.3.3.1 test/matchers/validate_attachment_presence_matcher_test.rb
radiant-paperclipped-extension-0.8.1 vendor/plugins/paperclip/test/matchers/validate_attachment_presence_matcher_test.rb
path-paperclip-2.3.3 test/matchers/validate_attachment_presence_matcher_test.rb
paperclip-2.3.5 test/matchers/validate_attachment_presence_matcher_test.rb
paperclip-2.3.4 test/matchers/validate_attachment_presence_matcher_test.rb
bookis-paperclip-2.3.3.1 test/matchers/validate_attachment_presence_matcher_test.rb
bookis-paperclip-2.3.3 test/matchers/validate_attachment_presence_matcher_test.rb
olek-paperclip-2.3.3 test/matchers/validate_attachment_presence_matcher_test.rb
davidray-paperclip-2.3.3 test/matchers/validate_attachment_presence_matcher_test.rb
mbailey-paperclip-2.3.3 test/matchers/validate_attachment_presence_matcher_test.rb
mbailey-paperclip-2.3.2.1 test/matchers/validate_attachment_presence_matcher_test.rb
mbailey-paperclip-2.3.2 test/matchers/validate_attachment_presence_matcher_test.rb
paperclip-2.3.3 test/matchers/validate_attachment_presence_matcher_test.rb
paperclip-2.3.2 test/matchers/validate_attachment_presence_matcher_test.rb
paperclip-cloudfiles-2.3.2 test/matchers/validate_attachment_presence_matcher_test.rb
paperclip-hacked-2.3.1.3 test/matchers/validate_attachment_presence_matcher_test.rb
paperclip-hacked-2.3.1.2 test/matchers/validate_attachment_presence_matcher_test.rb
paperclip-hacked-2.3.1.1 test/matchers/validate_attachment_presence_matcher_test.rb