Sha256: 5c1ece4ff1639c61b568133ed7cb4afd6d8b452e1dd5d3155adb227a272bcc92

Contents?: true

Size: 783 Bytes

Versions: 5

Compression:

Stored size: 783 Bytes

Contents

require 'spec_helper'

describe Attachment::Pdf do
  it_should_behave_like_an_attachment_with_dimensions(
    :type => :pdf,
    :missing_dimensions => [1, 1],
    :file_40x30 => 'test-40x30.pdf',
    :file_20x10 => 'test-20x10.pdf'
  )

  describe "#process" do
    use_model_class(:Thing, :attachment_file_name => :string)

    before do
      Thing.has_attachment :attachment
      @thing = Thing.new(:attachment => uploaded_file('test.pdf'))
    end

    it "should process with ImageMagick by default" do
      context = nil
      Thing.has_attachment :attachment do
        style :output
        process :on => :event do
          context = self
        end
      end

      @thing.attachment.process(:event)
      context.should be_a(Processor::ImageMagick)
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
bulldog-0.2.4 spec/unit/attachment/pdf_spec.rb
bulldog-0.2.3 spec/unit/attachment/pdf_spec.rb
bulldog-0.2.2 spec/unit/attachment/pdf_spec.rb
bulldog-0.2.1 spec/unit/attachment/pdf_spec.rb
bulldog-0.2.0 spec/unit/attachment/pdf_spec.rb