Sha256: 5f857e137b17bff555c03c4fe5bc5218fe5804c7d09a93be7bea079e8cf654c5
Contents?: true
Size: 1 KB
Versions: 7
Compression:
Stored size: 1 KB
Contents
shared_examples_for 'the icon helper' do all_tests_pass_with 'no icon options' all_tests_pass_with 'extra icon options' all_tests_pass_with 'the :library icon option' end #-- shared_examples_for 'no icon options' do specify 'creates a <span> with an icon' do html = '<span class="glyphicon glyphicon-zoom-in"></span>' expect(:icon).to generate html end end shared_examples_for 'extra icon options' do specify 'passes the options to the <span>' do options = {class: 'important', data: {value: 1}, id: 'my-icon'} html = '<span class="important glyphicon glyphicon-zoom-in" data-value="1" id="my-icon"></span>' expect(icon: options).to generate html end end shared_examples_for 'the :library icon option' do Bh::Icon.libraries.each do |library, library_class| specify %Q{set to :#{library}, adds the class "#{library_class}"} do html = %Q{<span class="#{library_class} #{library_class}-zoom-in"></span>} expect(icon: {library: library}).to generate html end end end
Version data entries
7 entries across 7 versions & 1 rubygems