Sha256: f8fa9eb43d478446756ad812ce80d93e60e91a4a3b53e8e9d357abd07130bddd

Contents?: true

Size: 785 Bytes

Versions: 2

Compression:

Stored size: 785 Bytes

Contents

shared_examples_for 'the button group helper' do
  all_tests_pass_with 'no button group options'
  all_tests_pass_with 'html attributes'
  all_tests_pass_with 'with buttons included'
end

#--

shared_examples_for 'no button group options' do
  specify 'sets the class to "btn-group"' do
    html = %r{class="btn-group"}
    expect(:button_group).to generate html
  end
end

shared_examples_for 'html attributes' do
  specify 'accepts html attributes' do
    html = %r{.+[data-foo="1"].}
    options = { role: 'group', data: { foo: 1 } }
    expect(button_group: options).to generate html
  end
end

shared_examples_for 'with buttons included' do
  specify 'accepts a block of buttons' do
    html = %r{button}
    railsstrap.button_group { expect(:button).to generate html }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
railsstrap-4.0.0.beta3 spec/shared/button_group_helper.rb
railsstrap-4.0.0.beta2 spec/shared/button_group_helper.rb