Sha256: 3adb8742363c304ce7c576ff895adb89be7656249b4298c61f8d26abf80b0711

Contents?: true

Size: 955 Bytes

Versions: 14

Compression:

Stored size: 955 Bytes

Contents

require 'test_helper'
class ToolbarTest < ActionView::TestCase
  include UiBibz::Helpers::Ui::CoreHelper

  test 'Toolbar' do
    actual = ui_toolbar do |t|
      t.button_group do |bg|
        bg.button 'Home'
      end
    end
    expected = "<div class=\"btn-toolbar\" role=\"toolbar\"><div class=\"btn-group\" role=\"group\"><button class=\"btn\">Home</button></div></div>"

    assert_equal expected, actual
  end

  test 'Toolbar justify' do
    actual = ui_toolbar justify: true do |t|
      t.button_group do |bg|
        bg.button 'Home'
      end
      t.spacer 2
      t.button_group do |bg|
        bg.button 'Home 2'
      end
    end
    expected = "<div class=\"btn-toolbar justify-content-between\" role=\"toolbar\"><div class=\"btn-group mr-2\" role=\"group\"><button class=\"btn\">Home</button></div><div class=\"btn-group\" role=\"group\"><button class=\"btn\">Home 2</button></div></div>"

    assert_equal expected, actual
  end

end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
ui_bibz-2.1.2 test/ui/core/navigations/toolbar_test.rb
ui_bibz-2.1.1 test/ui/core/navigations/toolbar_test.rb
ui_bibz-2.0.10 test/ui/core/navigations/toolbar_test.rb
ui_bibz-2.0.9 test/ui/core/navigations/toolbar_test.rb
ui_bibz-2.1.0 test/ui/core/navigations/toolbar_test.rb
ui_bibz-2.0.8 test/ui/core/navigations/toolbar_test.rb
ui_bibz-2.0.7 test/ui/core/navigations/toolbar_test.rb
ui_bibz-2.0.5 test/ui/core/navigations/toolbar_test.rb
ui_bibz-2.0.4 test/ui/core/navigations/toolbar_test.rb
ui_bibz-2.0.3 test/ui/core/navigations/toolbar_test.rb
ui_bibz-2.0.2 test/ui/core/navigations/toolbar_test.rb
ui_bibz-2.0.1 test/ui/core/navigations/toolbar_test.rb
ui_bibz-2.0.0 test/ui/core/navigations/toolbar_test.rb
ui_bibz-2.0.0.beta2.6 test/ui/core/navigations/toolbar_test.rb