Sha256: bd975e24e323dc543fd74511c0757c4cba92d2160dd745b5146af42828cf9009

Contents?: true

Size: 1.01 KB

Versions: 13

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', { status: :success, url: '#momo' }
      lg.list({ tap: true, active: true, url: '#state' }) do |l|
        l.header 'My title'
        l.body   'My body'
      end
    end.render
    expected = "<div class=\"list-group\"><a class=\"list-group-item-success list-group-item\" href=\"#momo\">Momo</a><a type=\"link\" class=\"list-group-item\" href=\"#state\"><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 'state'
    end.render
    expected = "<ul class=\"list-group\"><li class=\"list-group-item\">Lulu</li><li class=\"list-group-item\">state</li></ul>"

    assert_equal expected, actual
  end

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
ui_bibz-2.0.0.alpha24 test/ui/list_group_test.rb
ui_bibz-2.0.0.alpha23 test/ui/list_group_test.rb
ui_bibz-2.0.0.alpha22 test/ui/list_group_test.rb
ui_bibz-2.0.0.alpha21 test/ui/list_group_test.rb
ui_bibz-2.0.0.alpha20 test/ui/list_group_test.rb
ui_bibz-2.0.0.alpha19 test/ui/list_group_test.rb
ui_bibz-2.0.0.alpha18 test/ui/list_group_test.rb
ui_bibz-2.0.0.alpha16 test/ui/list_group_test.rb
ui_bibz-2.0.0.alpha15 test/ui/list_group_test.rb
ui_bibz-2.0.0.alpha14 test/ui/list_group_test.rb
ui_bibz-2.0.0.alpha13 test/ui/list_group_test.rb
ui_bibz-2.0.0.alpha12 test/ui/list_group_test.rb
ui_bibz-2.0.0.alpha11 test/ui/list_group_test.rb