Sha256: 4be1118fc1a9ce755b53ba6aaf3f591e8a913cf41f27b381a076bd0254cfde42
Contents?: true
Size: 1.13 KB
Versions: 1
Compression:
Stored size: 1.13 KB
Contents
require 'spec_helper' describe BootstrapIt::ViewHelpers::ButtonGroup do it { expect(helper.render).to have_tag 'div.btn-group' } # behaviour it { expect(helper).to be_kind_of BootstrapIt::ViewHelpers::Sizable } it { expect(helper).to be_kind_of BootstrapIt::ViewHelpers::Justifable } # vertical it 'has vertical switch' do expect( helper ).to have_flag(:vertical).with(html_class: ['btn-group-vertical']) end # buttons it 'renders buttons' do expect(helper { |h| h.button 'test' }.render).to have_tag( 'div.btn-group > button.btn.btn-default[text()="test"]' ) end it 'renders radios' do expect(helper { |h| h.radio 'test' }.render).to have_tag( 'div.btn-group[@data-toggle="buttons"]' \ ' > label.btn.btn-default[text()="test"] > input[@type="radio"]' ) end it 'renders checkboxes' do expect(helper { |h| h.checkbox 'test' }.render).to have_tag( 'div.btn-group[@data-toggle="buttons"]' \ ' > label.btn.btn-default[text()="test"] > input[@type="checkbox"]' ) end # class constants it { expect(described_class.html_class_prefix).to eq 'btn-group-' } end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
bootstrap_it-0.1.2 | spec/view_helpers/button_group_spec.rb |