Sha256: b6f19b427beb37b214674f4f05e7086aab0d10f39069fa231c5f7e349c56db6c
Contents?: true
Size: 1.56 KB
Versions: 2
Compression:
Stored size: 1.56 KB
Contents
shared_examples_for 'the nav helper' do all_tests_pass_with 'no nav options' all_tests_pass_with 'extra nav options' all_tests_pass_with 'the :as nav option' all_tests_pass_with 'the :layout nav option' all_tests_pass_with 'the nav wrapped in navbar' end #-- shared_examples_for 'no nav options' do specify 'creates a <nav> element with the "navigation" role' do html = %r{<nav.+role="navigation"(.*)<\/nav>} expect(:nav).to generate html end end shared_examples_for 'extra nav options' do specify 'passes the options to the <ul> element' do options = {class: 'important', data: {value: 1}, id: 'my-alert'} html = %r{(important).*(data-value="1").*(id="my-alert")} expect(nav: options).to generate html end end shared_examples_for 'the :as nav option' do Railsstrap::Nav.styles.each do |style, style_class| specify %Q{set to :#{context}, sets the class "#{style_class}"} do html = %r{<nav class="nav #{style_class}"} expect(nav: {as: style}).to generate html end end end shared_examples_for 'the :layout nav option' do Railsstrap::Nav.layouts.each do |layout, layout_class| specify %Q{set to :#{layout}, adds the class "#{layout_class}"} do html = %r{<nav class="nav #{layout_class}"} expect(nav: {layout: layout}).to generate html end end end shared_examples_for 'the nav wrapped in navbar' do specify 'creates a <nav> element with the "navbar-nav" class' do html = %r{<nav.*(role="navigation")*(class="nav navbar-nav").+<\/nav>} railsstrap.navbar { expect(:nav).to generate html } end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
railsstrap-4.0.0.beta3 | spec/shared/nav_helper.rb |
railsstrap-4.0.0.beta2 | spec/shared/nav_helper.rb |