Sha256: 7efe6132b34a18511610a2db5babd1556e999bd01d86c26af89c5d650bb13c71

Contents?: true

Size: 1.16 KB

Versions: 12

Compression:

Stored size: 1.16 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

12 entries across 12 versions & 2 rubygems

Version Path
qbrick-2.5.0.pre spec/lib/brick_list_spec.rb
kuhsaft-2.4.3 spec/lib/brick_list_spec.rb
kuhsaft-2.4.2 spec/lib/brick_list_spec.rb
kuhsaft-2.4.1 spec/lib/brick_list_spec.rb
kuhsaft-2.4.0 spec/lib/brick_list_spec.rb
kuhsaft-2.3.6 spec/lib/brick_list_spec.rb
kuhsaft-2.3.5 spec/lib/brick_list_spec.rb
kuhsaft-2.3.4 spec/lib/brick_list_spec.rb
kuhsaft-2.3.3 spec/lib/brick_list_spec.rb
kuhsaft-2.3.2 spec/lib/brick_list_spec.rb
kuhsaft-2.3.1 spec/lib/brick_list_spec.rb
kuhsaft-2.3.0 spec/lib/brick_list_spec.rb