Sha256: 7923305a7b3ab1586c622ec23eb4af8e206f6371f6031ce531e4051b587ea4a2

Contents?: true

Size: 1.67 KB

Versions: 42

Compression:

Stored size: 1.67 KB

Contents

require 'spec_helper'

describe Kuhsaft::TwoColumnBrick do

  let :two_column_brick do
    Kuhsaft::TwoColumnBrick.new
  end

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

  describe '#user_can_delete?' do
    it 'returns true' do
      two_column_brick.user_can_delete?.should be_true
    end
  end

  describe '#user_can_save?' do
    it 'returns true' do
      two_column_brick.user_can_save?.should be_true
    end
  end

  describe '#renders_own_childs?' do
    it 'returns true' do
      two_column_brick.renders_own_childs?.should be_true
    end
  end

  describe '#partitioning' do
    context 'when no partition is set' do
      it 'returns 0 (50/50)' do
        two_column_brick.partitioning.should be(0)
      end
    end

    context 'when the partition is set' do
      it 'returns the value' do
        two_column_brick.partitioning = 1
        two_column_brick.partitioning.should be(1)
      end
    end
  end

  describe '.partitionings' do
    it 'returns the 3 default partitions' do
      Kuhsaft::TwoColumnBrick.partitionings.should have(3).items
    end
  end

  describe '#create' do
    it 'creates two single columns as childs' do
      two_column_brick.save
      two_column_brick.bricks.should be_all { |brick| brick.should be_a(Kuhsaft::ColumnBrick) }
    end
  end

  describe '#bricks' do
    it 'can have childs' do
      two_column_brick.should respond_to(:bricks)
    end
  end

  describe '#to_style_class' do
    it 'adds the row class to the default styles' do
      Kuhsaft::TwoColumnBrick.new.to_style_class.should == 'kuhsaft-two-column-brick row-fluid'
    end
  end
end

Version data entries

42 entries across 42 versions & 1 rubygems

Version Path
kuhsaft-2.1.1 spec/models/two_column_brick_spec.rb
kuhsaft-2.1.0 spec/models/two_column_brick_spec.rb
kuhsaft-1.8.6 spec/models/two_column_brick_spec.rb
kuhsaft-1.8.5 spec/models/two_column_brick_spec.rb
kuhsaft-2.0.3 spec/models/two_column_brick_spec.rb
kuhsaft-2.0.2 spec/models/two_column_brick_spec.rb
kuhsaft-1.8.4 spec/models/two_column_brick_spec.rb
kuhsaft-1.8.1 spec/models/two_column_brick_spec.rb
kuhsaft-2.0.1 spec/models/two_column_brick_spec.rb
kuhsaft-2.0.0 spec/models/two_column_brick_spec.rb
kuhsaft-1.8.0 spec/models/two_column_brick_spec.rb
kuhsaft-1.7.1 spec/models/two_column_brick_spec.rb
kuhsaft-1.7.0 spec/models/two_column_brick_spec.rb
kuhsaft-1.6.0 spec/models/two_column_brick_spec.rb
kuhsaft-1.5.0 spec/models/two_column_brick_spec.rb
kuhsaft-1.4.3 spec/models/two_column_brick_spec.rb
kuhsaft-1.4.2 spec/models/two_column_brick_spec.rb
kuhsaft-1.4.1 spec/models/two_column_brick_spec.rb
kuhsaft-1.4.0 spec/models/two_column_brick_spec.rb
kuhsaft-1.3.1 spec/models/two_column_brick_spec.rb