Sha256: 39388077e06de1e686cc6a4fb16f031e17aea19609efa33bdf92e8ceab8b9ce9

Contents?: true

Size: 1.1 KB

Versions: 16

Compression:

Stored size: 1.1 KB

Contents

require 'spec_helper'

describe Qbrick::AccordionItemBrick, type: :model do
  let :accordion_item_brick do
    Qbrick::AccordionItemBrick.new
  end

  describe '#valid' do
    before do
      accordion_item_brick.valid?
    end

    context 'without a #caption' do
      it 'has en error' do
        expect(accordion_item_brick.errors[:caption].count).to eq(1)
      end
    end
  end

  describe '#user_can_delete?' do
    it 'returns true' do
      expect(accordion_item_brick.user_can_delete?).to be_truthy
    end
  end

  describe '#user_can_save' do
    it 'returns true' do
      expect(accordion_item_brick.user_can_save?).to eq(true)
    end
  end

  describe '#renders_own_childs?' do
    it 'returns false' do
      expect(accordion_item_brick.renders_own_childs?).to be_falsey
    end
  end

  describe '#bricks' do
    it 'can have childs' do
      expect(accordion_item_brick).to respond_to(:bricks)
    end
  end

  describe '#to_style_class' do
    it 'includes the bootstrap classname' do
      expect(accordion_item_brick.to_style_class).to eq('qbrick-accordion-item-brick accordion-group')
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

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