Sha256: 740ab63d2a5c174f14b2a3bd85d68639269a98b0109c9cbf70aa568f9328c7e2

Contents?: true

Size: 708 Bytes

Versions: 16

Compression:

Stored size: 708 Bytes

Contents

require 'spec_helper'

describe Qbrick::TextBrick, type: :model do
  let :text_brick do
    Qbrick::TextBrick.new
  end

  describe '#bricks' do
    it 'can not have childs' do
      expect(text_brick).not_to respond_to(:bricks)
    end
  end

  describe '#user_can_add_childs?' do
    it 'returns false' do
      expect(text_brick.user_can_add_childs?).to be_falsey
    end
  end

  describe '#collect_fulltext' do
    before do
      text_brick.text = '<div><b>foo</b> <b>bar</b></div>'
      text_brick.read_more_text = '<div><span>foo</span><span>bar</span></div>'
    end

    it 'sanitizes text and read_more_text' do
      expect(text_brick.collect_fulltext).to eq('foo bar foobar')
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
qbrick-2.7.1 spec/models/text_brick_spec.rb
qbrick-2.7 spec/models/text_brick_spec.rb
qbrick-2.6.10 spec/models/text_brick_spec.rb
qbrick-2.6.9 spec/models/text_brick_spec.rb
qbrick-2.6.8 spec/models/text_brick_spec.rb
qbrick-2.6.7 spec/models/text_brick_spec.rb
qbrick-2.6.6 spec/models/text_brick_spec.rb
qbrick-2.6.5 spec/models/text_brick_spec.rb
qbrick-2.6.4 spec/models/text_brick_spec.rb
qbrick-2.6.3 spec/models/text_brick_spec.rb
qbrick-2.6.2 spec/models/text_brick_spec.rb
qbrick-2.6.1 spec/models/text_brick_spec.rb
qbrick-2.6.0 spec/models/text_brick_spec.rb
qbrick-2.5.2 spec/models/text_brick_spec.rb
qbrick-2.5.1 spec/models/text_brick_spec.rb
qbrick-2.5.0 spec/models/text_brick_spec.rb