Sha256: 2d6fdbd88a92344dd1bab9625d99d4879358c4b6fb61966245a6854307ea34eb

Contents?: true

Size: 969 Bytes

Versions: 4

Compression:

Stored size: 969 Bytes

Contents

require 'spec_helper'
require 'support/active_record'
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

4 entries across 4 versions & 1 rubygems

Version Path
adminpanel-0.1.0cl.2 spec/uploaders/image_uploader_spec.rb
adminpanel-0.1.0cl spec/uploaders/image_uploader_spec.rb
adminpanel-0.1.0 spec/uploaders/image_uploader_spec.rb
adminpanel-0.0.7 spec/uploaders/image_uploader_spec.rb