Sha256: 805098522d50a7b05760e100312d73a5cfe1566bc7a4b7214715a53160e995ce

Contents?: true

Size: 821 Bytes

Versions: 16

Compression:

Stored size: 821 Bytes

Contents

require 'spec_helper'

describe Qbrick::Asset, type: :model do
  let :asset do
    create(:asset)
  end

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

  before do
    Qbrick::AssetUploader.enable_processing = true
  end

  after do
    Qbrick::AssetUploader.enable_processing = false
  end

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

  it 'makes the image readable only to the owner and not executable' do
    expect(uploader.permissions).to eq(0600)
  end

  describe '#file_type' do
    it 'has a file_type' do
      expect(asset).to respond_to(:file_type)
    end

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

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
qbrick-2.7.1 spec/models/asset_spec.rb
qbrick-2.7 spec/models/asset_spec.rb
qbrick-2.6.10 spec/models/asset_spec.rb
qbrick-2.6.9 spec/models/asset_spec.rb
qbrick-2.6.8 spec/models/asset_spec.rb
qbrick-2.6.7 spec/models/asset_spec.rb
qbrick-2.6.6 spec/models/asset_spec.rb
qbrick-2.6.5 spec/models/asset_spec.rb
qbrick-2.6.4 spec/models/asset_spec.rb
qbrick-2.6.3 spec/models/asset_spec.rb
qbrick-2.6.2 spec/models/asset_spec.rb
qbrick-2.6.1 spec/models/asset_spec.rb
qbrick-2.6.0 spec/models/asset_spec.rb
qbrick-2.5.2 spec/models/asset_spec.rb
qbrick-2.5.1 spec/models/asset_spec.rb
qbrick-2.5.0 spec/models/asset_spec.rb