Sha256: 6396a3e149bc7638a11ede1351d58d3ae4ca7837c967cf7cec4c12227b248e06

Contents?: true

Size: 1.01 KB

Versions: 17

Compression:

Stored size: 1.01 KB

Contents

require 'test_helper'
include UiBibz::Helpers
class ListGroupTest < ActionView::TestCase

  test 'list_group with link' do
    actual = UiBibz::Ui::Core::ListGroup.new(type: :link).tap do |lg|
      lg.list 'Momo', { state: :success, url: '#momo' }
      lg.list({ tap: true, active: true, url: '#toto' }) do |l|
        l.header 'My title'
        l.body   'My body'
      end
    end.render
    expected = "<div class=\"list-group\"><a href=\"#momo\" class=\"list-group-item-success list-group-item\">Momo</a><a type=\"link\" href=\"#toto\" class=\"list-group-item\"><h4 class=\"list-group-item-heading\">My title</h4><p class=\"list-group-item-text\">My body</p></a></div>"

    assert_equal expected, actual
  end

  test 'list_group' do
    actual = UiBibz::Ui::Core::ListGroup.new().tap do |lg|
      lg.list 'Lulu'
      lg.list 'Toto'
    end.render
    expected = "<ul class=\"list-group\"><li class=\"list-group-item\">Lulu</li><li class=\"list-group-item\">Toto</li></ul>"

    assert_equal expected, actual
  end

end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
ui_bibz-1.2.5.3 test/ui/list_group_test.rb
ui_bibz-1.2.5.2 test/ui/list_group_test.rb
ui_bibz-1.2.5.1 test/ui/list_group_test.rb
ui_bibz-1.2.5 test/ui/list_group_test.rb
ui_bibz-1.2.4 test/ui/list_group_test.rb
ui_bibz-1.2.3 test/ui/list_group_test.rb
ui_bibz-1.2.2 test/ui/list_group_test.rb
ui_bibz-1.2.1 test/ui/list_group_test.rb
ui_bibz-1.2.0 test/ui/list_group_test.rb
ui_bibz-1.1.7 test/ui/list_group_test.rb
ui_bibz-1.1.6 test/ui/list_group_test.rb
ui_bibz-1.1.5 test/ui/list_group_test.rb
ui_bibz-1.1.4 test/ui/list_group_test.rb
ui_bibz-1.1.3 test/ui/list_group_test.rb
ui_bibz-1.1.2 test/ui/list_group_test.rb
ui_bibz-1.1.1 test/ui/list_group_test.rb
ui_bibz-1.1.0 test/ui/list_group_test.rb