Skip to content

Instantly share code, notes, and snippets.

@chadoh
Created July 1, 2011 12:34
Show Gist options
  • Save chadoh/1058444 to your computer and use it in GitHub Desktop.
Save chadoh/1058444 to your computer and use it in GitHub Desktop.
require 'spec_helper'
require 'carrierwave/test/matchers'
describe CoverArtUploader do
include CarrierWave::Test::Matchers
before do
CoverArtUploader.enable_processing = true
@uploader = CoverArtUploader.new(CoverArt.create, :image)
@uploader.store!(File.open("#{Rails.root}/spec/uploaders/fruit.jpg", "r"))
end
after do
CoverArtUploader.enable_processing = false
end
# describe '#thumb' do
# it "scales down a landscape image to be exactly 64 by 64 pixels" do
# @uploader.thumb.should have_dimensions(64, 64)
# end
# end
# describe '#small' do
# it "scales down a landscape image to fit within 200 by 200 pixels" do
# @uploader.small.should be_no_larger_than(200, 200)
# end
# end
it "makes the image readable to anyone but not executable" do
@uploader.should have_permissions(0666)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment