Sha256: 12a1a57452e54f2c50eedd4827c41a6d0cfc096f6f0e5994cebad98b12951363

Contents?: true

Size: 879 Bytes

Versions: 6

Compression:

Stored size: 879 Bytes

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

end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
kuhsaft-1.1.1 spec/lib/brick_list_spec.rb
kuhsaft-1.1.0 spec/lib/brick_list_spec.rb
kuhsaft-1.0.3 spec/lib/brick_list_spec.rb
kuhsaft-1.0.2 spec/lib/brick_list_spec.rb
kuhsaft-1.0.1 spec/lib/brick_list_spec.rb
kuhsaft-1.0.0 spec/lib/brick_list_spec.rb