Sha256: b1b4884a0d206c081b51158f5686361285d6338438b31fa1dc22b0e88d669169

Contents?: true

Size: 875 Bytes

Versions: 50

Compression:

Stored size: 875 Bytes

Contents

require 'spec_helper'

describe Kuhsaft::Asset do

  let :asset do
    create(:asset)
  end

  let :uploader do
    u = Kuhsaft::AssetUploader.new(asset, :file)
    u.store!(File.open(File.join(Kuhsaft::Engine.root, 'spec', 'dummy', 'app', 'assets', 'images', 'spec-image.png')))
    u
  end

  before do
    Kuhsaft::AssetUploader.enable_processing = true
  end

  after do
    Kuhsaft::AssetUploader.enable_processing = false
  end

  it 'has a thumbnail' do
    uploader.should respond_to(:thumb)
  end

  it "makes 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 'has a file_type' do
      asset.should respond_to(:file_type)
    end

    it 'is symbolized' do
      asset.file_type.should be_a(Symbol)
    end
  end
end

Version data entries

50 entries across 50 versions & 1 rubygems

Version Path
kuhsaft-1.2.3 spec/models/asset_spec.rb
kuhsaft-1.2.2 spec/models/asset_spec.rb
kuhsaft-1.2.1 spec/models/asset_spec.rb
kuhsaft-1.2.0 spec/models/asset_spec.rb
kuhsaft-1.1.1 spec/models/asset_spec.rb
kuhsaft-1.1.0 spec/models/asset_spec.rb
kuhsaft-1.0.3 spec/models/asset_spec.rb
kuhsaft-1.0.2 spec/models/asset_spec.rb
kuhsaft-1.0.1 spec/models/asset_spec.rb
kuhsaft-1.0.0 spec/models/asset_spec.rb