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
kuhsaft-1.2.15 spec/models/asset_brick_spec.rb
kuhsaft-1.2.14 spec/models/asset_brick_spec.rb
kuhsaft-1.2.13 spec/models/asset_brick_spec.rb
kuhsaft-1.2.12 spec/models/asset_brick_spec.rb
kuhsaft-1.2.11 spec/models/asset_brick_spec.rb
kuhsaft-1.2.10 spec/models/asset_brick_spec.rb