Sha256: 52cd68f177b9f8d3015ce194c91aab127284cf5304cc8350f1d9b7a3c7c6a98d

Contents?: true

Size: 1 KB

Versions: 6

Compression:

Stored size: 1 KB

Contents

require 'spec_helper'

describe Kuhsaft::Asset do
  before do
    Kuhsaft::AssetUploader.enable_processing = true
    @asset = Kuhsaft::Asset.new
    @uploader = Kuhsaft::AssetUploader.new(@asset, :file)
    @uploader.store!(File.open(File.join(Kuhsaft::Engine.root, 'spec', 'dummy', 'public', 'images', 'spec-image.png')))
  end
  
  after do
    Kuhsaft::AssetUploader.enable_processing = false
  end
  
  it 'should scale down to fit into a 100x100 thumb' do
    @uploader.thumb.should have_dimensions(100, 100)
  end
  
  it "should make the image readable only to the owner and not executable" do
    pending 'how and where do we ensure permissions?'
    @uploader.should have_permissions(0600)
  end
  
  describe '#file_type' do
    it 'should have a file_type' do
      @asset.should respond_to(:file_type)
    end
    
    it 'should be symbolized' do
      @asset.file_type.should be_a(Symbol)
    end
  end
  
  describe '#name' do
    it 'should have a name' do
      @asset.should respond_to(:name)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
kuhsaft-0.2.legacy4 spec/models/asset_spec.rb
kuhsaft-0.2.legacy3 spec/models/asset_spec.rb
kuhsaft-0.2.legacy2 spec/models/asset_spec.rb
kuhsaft-0.2.legacy spec/models/asset_spec.rb
kuhsaft-0.2.1 spec/models/asset_spec.rb
kuhsaft-0.2 spec/models/asset_spec.rb