Sha256: 6cddd39e7051188e36580195b1d28e110c9ac90f7cad95ba2b2826be1dc88e95

Contents?: true

Size: 936 Bytes

Versions: 1

Compression:

Stored size: 936 Bytes

Contents

require 'spec_helper'
require 'carrierwave/test/matchers'

describe Adminpanel::ImageUploader do
  include CarrierWave::Test::Matchers

  before do
    Adminpanel::ImageUploader.enable_processing = true
    @image = Adminpanel::Image.new(:file => "test.jpg")
    @image_uploader = Adminpanel::ImageUploader.new(@image, :file)
    @image_uploader.store!(File.open(Rails.root + "app/assets/images/test.jpg"))
  end

  after do
    Adminpanel::ImageUploader.enable_processing = false
    @image_uploader.remove!
  end

  context 'the thumb version' do
    it "should scale down a landscape image to be exactly 220 by 220 pixels" do
      @image_uploader.thumb.should be_no_larger_than(220, 220)
    end
  end

  context 'the porfolio version' do
    it "should scale down a landscape image to be exactly 468 by 312 pixels" do
      @image_uploader.portfolio.should be_no_larger_than(468, 312)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
adminpanel-0.1.1 spec/uploaders/image_uploader_spec.rb