Sha256: 92c2893036a5f8eb46353533c88452ab6e5ce41566dca209a4b2dc3cad463079

Contents?: true

Size: 910 Bytes

Versions: 15

Compression:

Stored size: 910 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


  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
  
  after do
    Adminpanel::ImageUploader.enable_processing = false
    @image_uploader.remove!
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
adminpanel-1.2.12 spec/uploaders/image_uploader_spec.rb
adminpanel-1.2.11 spec/uploaders/image_uploader_spec.rb
adminpanel-1.2.10 spec/uploaders/image_uploader_spec.rb
adminpanel-1.2.9 spec/uploaders/image_uploader_spec.rb
adminpanel-1.2.8 spec/uploaders/image_uploader_spec.rb
adminpanel-1.2.7 spec/uploaders/image_uploader_spec.rb
adminpanel-1.2.6 spec/uploaders/image_uploader_spec.rb
adminpanel-1.2.5 spec/uploaders/image_uploader_spec.rb
adminpanel-1.2.4 spec/uploaders/image_uploader_spec.rb
adminpanel-1.2.3 spec/uploaders/image_uploader_spec.rb
adminpanel-1.2.2 spec/uploaders/image_uploader_spec.rb
adminpanel-1.2.1 spec/uploaders/image_uploader_spec.rb
adminpanel-1.2.0 spec/uploaders/image_uploader_spec.rb
adminpanel-1.1.0 spec/uploaders/image_uploader_spec.rb
adminpanel-1.0.0 spec/uploaders/image_uploader_spec.rb