Sha256: 2917f0395c16798ebf9a12f358e4f6898f8ae1f491d73cdebf5a516d79d562d4

Contents?: true

Size: 1.04 KB

Versions: 56

Compression:

Stored size: 1.04 KB

Contents

require 'spec_helper'

describe Kuhsaft::LinkBrick do

  let :link_brick do
    Kuhsaft::LinkBrick.new
  end

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

    context 'without a #href' do
      it 'has en error' do
        link_brick.should have(1).error_on(:href)
      end
    end

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

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

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

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

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

Version data entries

56 entries across 56 versions & 2 rubygems

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