Sha256: 4b5e4f9831df8c5f35e6fbec8d9ca38c75b1dd51b6de24fe5cc618df7d59eaf6

Contents?: true

Size: 715 Bytes

Versions: 2

Compression:

Stored size: 715 Bytes

Contents

shared_examples_for 'the glyphicon helper' do
  all_tests_pass_with 'no glyphicon options'
  all_tests_pass_with 'extra glyphicon options'
end

#--

shared_examples_for 'no glyphicon options' do
  specify 'creates a <i> with an icon' do
    html = '<i class="glyphicon glyphicon-zoom-in"></i>'
    expect(glyphicon: :zoom_in).to generate html
  end
end

shared_examples_for 'extra glyphicon options' do
  specify 'passes the options to the <span>' do
    options = {name: :zoom_in, tag: :span, class: 'important', data: {value: 1}, id: 'my-glyphicon'}
    html = '<span class="important glyphicon glyphicon-zoom-in" data-value="1" id="my-glyphicon"></span>'
    expect(glyphicon: options).to generate html
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

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