Sha256: 158e784509e81c1f44f00ae4122f3768616c9e2166dec9221518f717622873fb

Contents?: true

Size: 998 Bytes

Versions: 10

Compression:

Stored size: 998 Bytes

Contents

require 'spec_helper'

describe Kuhsaft::Asset do
  before do
    Kuhsaft::AssetUploader.enable_processing = true
    @asset = Factory(:asset)
    @uploader = Kuhsaft::AssetUploader.new(@asset, :file)
    @uploader.store!(File.open(File.join(Kuhsaft::Engine.root, 'spec', 'dummy', 'app', 'assets', 'images', 'spec-image.png')))
  end
  
  after do
    Kuhsaft::AssetUploader.enable_processing = false
  end
  
  it 'should have a thumbnail' do
    @uploader.should respond_to(:thumb)
  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

10 entries across 10 versions & 1 rubygems

Version Path
kuhsaft-0.3.4.legacy3 spec/models/asset_spec.rb
kuhsaft-0.3.4.legacy2 spec/models/asset_spec.rb
kuhsaft-0.3.4.legacy spec/models/asset_spec.rb
kuhsaft-0.3.6 spec/models/asset_spec.rb
kuhsaft-0.3.5 spec/models/asset_spec.rb
kuhsaft-0.3.4 spec/models/asset_spec.rb
kuhsaft-0.3.4.rc2 spec/models/asset_spec.rb
kuhsaft-0.3.4.rc1 spec/models/asset_spec.rb
kuhsaft-0.3.3 spec/models/asset_spec.rb
kuhsaft-0.3.2 spec/models/asset_spec.rb