Sha256: 3522db822346ed232702365757e1a99cbfc512ee68e64e504536ee24474a5c12

Contents?: true

Size: 1.17 KB

Versions: 44

Compression:

Stored size: 1.17 KB

Contents

require 'spec_helper'

describe Kuhsaft::BrickList do

  class TestBrick
    include Kuhsaft::BrickList
  end

  let :brick do
    TestBrick.new
  end

  describe '#collect_fulltext' do
    context 'with bricks' do
      it 'collects its childs fulltext' do
        brick.stub_chain(:bricks, :localized).and_return([mock_model(Kuhsaft::Brick, :collect_fulltext => 'hallo')])
        brick.collect_fulltext.should == 'hallo'
      end
    end

    context 'with bricks without content' do
      it 'returns a string' do
        brick.stub_chain(:bricks, :localized).and_return([])
        brick.collect_fulltext.should == ''
      end
    end

    context 'without bricks' do
      it 'returns a string' do
        brick.collect_fulltext.should == ''
      end

      it 'does not fail' do
        expect { brick.collect_fulltext }.to_not raise_error
      end
    end
  end

  describe '#allowed_brick_types' do
    it 'returns an array of possible classes as strings' do
      brick.allowed_brick_types.should be_a(Array)
    end
  end

  describe '#brick_types' do
    it 'returns a Kuhsaft::BrickTypeFilter' do
      brick.brick_types.should be_a(Kuhsaft::BrickTypeFilter)
    end
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
kuhsaft-2.2.6 spec/lib/brick_list_spec.rb
kuhsaft-2.2.5 spec/lib/brick_list_spec.rb
kuhsaft-2.2.4 spec/lib/brick_list_spec.rb
kuhsaft-2.2.3 spec/lib/brick_list_spec.rb
kuhsaft-2.2.2 spec/lib/brick_list_spec.rb
kuhsaft-2.2.1 spec/lib/brick_list_spec.rb
kuhsaft-2.2.0 spec/lib/brick_list_spec.rb
kuhsaft-2.1.2 spec/lib/brick_list_spec.rb
kuhsaft-2.1.1 spec/lib/brick_list_spec.rb
kuhsaft-2.1.0 spec/lib/brick_list_spec.rb
kuhsaft-1.8.6 spec/lib/brick_list_spec.rb
kuhsaft-1.8.5 spec/lib/brick_list_spec.rb
kuhsaft-2.0.3 spec/lib/brick_list_spec.rb
kuhsaft-2.0.2 spec/lib/brick_list_spec.rb
kuhsaft-1.8.4 spec/lib/brick_list_spec.rb
kuhsaft-1.8.1 spec/lib/brick_list_spec.rb
kuhsaft-2.0.1 spec/lib/brick_list_spec.rb
kuhsaft-2.0.0 spec/lib/brick_list_spec.rb
kuhsaft-1.8.0 spec/lib/brick_list_spec.rb
kuhsaft-1.7.1 spec/lib/brick_list_spec.rb