Sha256: 612def1f329f78352e705616388651e1654d0ba778e5cbd01492dcc2e8e45a69

Contents?: true

Size: 943 Bytes

Versions: 46

Compression:

Stored size: 943 Bytes

Contents

require 'spec_helper'

describe Kuhsaft::AssetBrick do

  let :asset_brick do
    Kuhsaft::AssetBrick.new
  end

  describe '#valid' do
    before do
      asset_brick.valid?
    end

    context 'without a #caption' do
      it 'has an error' do
        asset_brick.should have(1).error_on(:caption)
      end
    end
  end

  describe '#bricks' do
    it 'can not have childs' do
      asset_brick.should_not respond_to(:bricks)
    end
  end

  describe '.styles' do
    it 'returns the available link styles' do
      Kuhsaft::AssetBrick.styles.should == %w(pdf word excel button)
    end
  end

  describe '#to_style_class' do
    it 'includes the link style' do
      asset_brick.stub(:link_style).and_return('pdf')
      asset_brick.to_style_class.should == 'kuhsaft-asset-brick pdf'
    end
  end

  describe '#user_can_add_childs?' do
    it 'returns false' do
      asset_brick.user_can_add_childs?.should be_false
    end
  end
end

Version data entries

46 entries across 46 versions & 2 rubygems

Version Path
qbrick-2.5.0.pre spec/models/asset_brick_spec.rb
kuhsaft-2.4.3 spec/models/asset_brick_spec.rb
kuhsaft-2.4.2 spec/models/asset_brick_spec.rb
kuhsaft-2.4.1 spec/models/asset_brick_spec.rb
kuhsaft-2.4.0 spec/models/asset_brick_spec.rb
kuhsaft-2.3.6 spec/models/asset_brick_spec.rb
kuhsaft-2.3.5 spec/models/asset_brick_spec.rb
kuhsaft-2.3.4 spec/models/asset_brick_spec.rb
kuhsaft-2.3.3 spec/models/asset_brick_spec.rb
kuhsaft-2.3.2 spec/models/asset_brick_spec.rb
kuhsaft-2.3.1 spec/models/asset_brick_spec.rb
kuhsaft-2.3.0 spec/models/asset_brick_spec.rb
kuhsaft-2.2.6 spec/models/asset_brick_spec.rb
kuhsaft-2.2.5 spec/models/asset_brick_spec.rb
kuhsaft-2.2.4 spec/models/asset_brick_spec.rb
kuhsaft-2.2.3 spec/models/asset_brick_spec.rb
kuhsaft-2.2.2 spec/models/asset_brick_spec.rb
kuhsaft-2.2.1 spec/models/asset_brick_spec.rb
kuhsaft-2.2.0 spec/models/asset_brick_spec.rb
kuhsaft-2.1.2 spec/models/asset_brick_spec.rb