Sha256: 6e4aa8ef2767435dc6b09b800f5a2dd3d3383ac229a002af9b41fabe97932716

Contents?: true

Size: 1.4 KB

Versions: 3

Compression:

Stored size: 1.4 KB

Contents

require 'test_helper'
class NavTest < ActionView::TestCase

  test 'Nav with tab' do
    actual = ui_nav(type: :tabs) do |n|
      n.link 'Home', state: :active, url: "#Home", selector: 'home'
      n.link 'Profile', url: "#profile", selector: 'profile'
      n.link 'Messages', url: "#messages", selector: 'messages'
    end
    expected = "<ul class=\"nav nav-tabs\"><li class=\"nav-item\"><a class=\"active nav-link\" data-toggle=\"tab\" role=\"tab\" href=\"#Home\">Home</a></li><li class=\"nav-item\"><a class=\"nav-link\" data-toggle=\"tab\" role=\"tab\" href=\"#profile\">Profile</a></li><li class=\"nav-item\"><a class=\"nav-link\" data-toggle=\"tab\" role=\"tab\" href=\"#messages\">Messages</a></li></ul>"
    assert_equal expected, actual
  end

  test 'Nav with pills' do
    actual = ui_nav(type: :pills, position: :justified) do |n|
      n.link 'Home', state: :active, url: "#Home", selector: 'home'
      n.link 'Profile', url: "#profile", selector: 'profile', label: 16
      n.link 'Messages', url: "#messages", selector: 'messages', state: :disabled
    end
    expected = "<ul class=\"nav nav-pills pull-justified\"><li class=\"nav-item\"><a class=\"active nav-link\" href=\"#Home\">Home</a></li><li class=\"nav-item\"><a class=\"nav-link\" href=\"#profile\">Profile</a></li><li class=\"nav-item\"><a class=\"disabled nav-link\" href=\"#messages\">Messages</a></li></ul>"

    assert_equal expected, actual
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ui_bibz-2.0.0.beta2.2 test/ui/core/navs/nav_test.rb
ui_bibz-2.0.0.beta2.1 test/ui/core/navs/nav_test.rb
ui_bibz-2.0.0.beta2 test/ui/core/navs/nav_test.rb