Sha256: cee8c029c4de03067a56f206ec920d3c05f909011f6ddcd175bd1f776aed99cd

Contents?: true

Size: 962 Bytes

Versions: 22

Compression:

Stored size: 962 Bytes

Contents

require 'spec_helper'

describe Dragonfly::ImageMagick::Generators::Plasma do
  let (:generator) { Dragonfly::ImageMagick::Generators::Plasma.new }
  let (:app) { test_imagemagick_app }
  let (:image) { Dragonfly::Content.new(app) }

  describe "call" do
    it "generates a png image" do
      generator.call(image, 5, 3)
      image.should have_width(5)
      image.should have_height(3)
      image.should have_format('png')
      image.meta.should == {'format' => 'png', 'name' => 'plasma.png'}
    end

    it "allows changing the format" do
      generator.call(image, 1, 1, 'format' => 'jpg')
      image.should have_format('jpeg')
      image.meta.should == {'format' => 'jpg', 'name' => 'plasma.jpg'}
    end
  end

  describe "urls" do
    it "updates the url" do
      url_attributes = Dragonfly::UrlAttributes.new
      generator.update_url(url_attributes, 1, 1, 'format' => 'jpg')
      url_attributes.name.should == 'plasma.jpg'
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
dragonfly-1.3.0 spec/dragonfly/image_magick/generators/plasma_spec.rb
dragonfly-1.2.1 spec/dragonfly/image_magick/generators/plasma_spec.rb
dragonfly-1.2.0 spec/dragonfly/image_magick/generators/plasma_spec.rb
dragonfly-1.1.5 spec/dragonfly/image_magick/generators/plasma_spec.rb
dragonfly-1.1.4 spec/dragonfly/image_magick/generators/plasma_spec.rb
dragonfly-1.1.3 spec/dragonfly/image_magick/generators/plasma_spec.rb
dragonfly-1.1.2 spec/dragonfly/image_magick/generators/plasma_spec.rb
dragonfly-1.1.1 spec/dragonfly/image_magick/generators/plasma_spec.rb
dragonfly-1.1.0 spec/dragonfly/image_magick/generators/plasma_spec.rb
dragonfly-1.0.12 spec/dragonfly/image_magick/generators/plasma_spec.rb
dragonfly-1.0.11 spec/dragonfly/image_magick/generators/plasma_spec.rb
dragonfly-1.0.10 spec/dragonfly/image_magick/generators/plasma_spec.rb
dragonfly-1.0.9 spec/dragonfly/image_magick/generators/plasma_spec.rb
dragonfly-1.0.8 spec/dragonfly/image_magick/generators/plasma_spec.rb
dragonfly-1.0.7 spec/dragonfly/image_magick/generators/plasma_spec.rb
dragonfly-1.0.6 spec/dragonfly/image_magick/generators/plasma_spec.rb
dragonfly-1.0.5 spec/dragonfly/image_magick/generators/plasma_spec.rb
dragonfly-1.0.4 spec/dragonfly/image_magick/generators/plasma_spec.rb
dragonfly-1.0.3 spec/dragonfly/image_magick/generators/plasma_spec.rb
dragonfly-1.0.2 spec/dragonfly/image_magick/generators/plasma_spec.rb