Sha256: 003d6d5581c716c2eedeba54d86f7baf3e18b6a96d93de4e4bda943672735202

Contents?: true

Size: 809 Bytes

Versions: 2

Compression:

Stored size: 809 Bytes

Contents

require 'spec_helper'

describe Kuhsaft::TextBrick do

  let :text_brick do
    Kuhsaft::TextBrick.new
  end

  describe 'saving with empty read more text' do

    before :each do
      text_brick.text = 'foo'
      text_brick.read_more_text = '<p>\xE2\x80\x8B</p>'
      text_brick.brick_list_id = 1
    end

    it 'strips empty p tag from read more text' do
      # TODO: do this without stubbing.
      text_brick.stub(:text_contains_funky_chars).and_return(:true)
      text_brick.save
      text_brick.read_more_text.should be_empty
    end
  end

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

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
kuhsaft-1.2.12 spec/models/text_brick_spec.rb
kuhsaft-1.2.11 spec/models/text_brick_spec.rb