Sha256: d07591145796390b1251511572c672e3a27d30d3b72ce37dca7b42f4911b0e8c

Contents?: true

Size: 1001 Bytes

Versions: 7

Compression:

Stored size: 1001 Bytes

Contents

require 'spec_helper'
require 'support/active_record'
require 'carrierwave/test/matchers'

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

  before do
    Adminpanel::GalleryUploader.enable_processing = true
    @gallery = Adminpanel::Gallery.new(:file => "test.jpg")
    @gallery_uploader = Adminpanel::GalleryUploader.new(@gallery, :file)
    @gallery_uploader.store!(File.open(Rails.root + "app/assets/images/hipster.jpg"))
  end

  after do
    Adminpanel::GalleryUploader.enable_processing = false
    @gallery_uploader.remove!
  end

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

  context 'the gallery.default version' do
    it "should scale down a landscape image to fit within 1024 by 450 pixels" do
      @gallery_uploader.should have_dimensions(1024, 450)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
adminpanel-0.1.0cl.2 spec/uploaders/gallery_uploader_spec.rb
adminpanel-0.1.0cl spec/uploaders/gallery_uploader_spec.rb
adminpanel-0.1.0 spec/uploaders/gallery_uploader_spec.rb
adminpanel-0.0.7 spec/uploaders/gallery_uploader_spec.rb
adminpanel-0.0.6.1 spec/uploaders/gallery_uploader_spec.rb
adminpanel-0.0.6 spec/uploaders/gallery_uploader_spec.rb
adminpanel-0.0.5 spec/uploaders/adminpanel/gallery_uploader_spec.rb