Sha256: b26fc81e40181d003583fb5b9ad21fb8cd2bad6686e2339f9ee5b89d2b3468a7

Contents?: true

Size: 969 Bytes

Versions: 13

Compression:

Stored size: 969 Bytes

Contents

module Woulda
  module AttachmentFu
    module Macros
      def should_have_attachment(options = {})
        klass = model_class

        should_have_db_columns :size, :content_type, :filename
        if options[:content_type] == :image
          should_have_db_columns :height, :width
        end

        should "define AttachmentFu class methods" do
          # breakpoint
          class_modules = (class << klass; included_modules; end)
          assert class_modules.include?(Technoweenie::AttachmentFu::ClassMethods),
                                        "#{klass} doesn't define AttachmentFu class methods"
        end

        should "define AttachmentFu instance methods" do
          instance_modules = klass.included_modules
          assert instance_modules.include?(Technoweenie::AttachmentFu::InstanceMethods),
                                            "#{klass} doesn't define AttachmentFu instance methods"
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 3 rubygems

Version Path
clearlynuts-woulda-0.2.3 lib/woulda/attachment_fu/macros.rb
clearlynuts-woulda-0.2.4 lib/woulda/attachment_fu/macros.rb
seanhussey-woulda-0.0.2 lib/woulda/attachment_fu/macros.rb
seanhussey-woulda-0.1.1 lib/woulda/attachment_fu/macros.rb
seanhussey-woulda-0.1.2 lib/woulda/attachment_fu/macros.rb
seanhussey-woulda-0.1.3 lib/woulda/attachment_fu/macros.rb
seanhussey-woulda-0.1.4 lib/woulda/attachment_fu/macros.rb
seanhussey-woulda-0.1.5 lib/woulda/attachment_fu/macros.rb
seanhussey-woulda-0.1.6 lib/woulda/attachment_fu/macros.rb
seanhussey-woulda-0.2.0 lib/woulda/attachment_fu/macros.rb
seanhussey-woulda-0.2.1 lib/woulda/attachment_fu/macros.rb
seanhussey-woulda-0.2.2 lib/woulda/attachment_fu/macros.rb
webmat-woulda-0.1.7 lib/woulda/attachment_fu/macros.rb