Sha256: f7133e6e50193b73276b7426fc3d3759fab356c8b943441197e0f95a54254b87

Contents?: true

Size: 921 Bytes

Versions: 7

Compression:

Stored size: 921 Bytes

Contents

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

  test 'alert' do
    actual = ui_alert 'state'
    expected = "<div class=\"alert-info alert alert-dismissible\" role=\"alert\">state</div>"

    assert_equal expected, actual
  end

  test 'alert with more informaton' do
    actual = ui_alert(tap: true, status: :success, glyph: 'thumbs-o-up', closable: true) do |a|
      a.header 'Information'
      a.body 'Body text'
    end
    expected = "<div class=\"alert-success alert alert-dismissible\" role=\"alert\"><h4 class=\"alert-header\"><i class=\"glyph fa fa-thumbs-o-up\"></i> Information<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">×</span><span class=\"sr-only\">Close</span></button></h4><hr /><p class=\"alert-body mb-0\">Body text</p></div>"

    assert_equal expected, actual
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ui_bibz-2.0.0.beta2.6 test/ui/core/notifications/alert_test.rb
ui_bibz-2.0.0.beta2.5 test/ui/core/notifications/alert_test.rb
ui_bibz-2.0.0.beta2.4 test/ui/core/notifications/alert_test.rb
ui_bibz-2.0.0.beta2.3 test/ui/core/notifications/alert_test.rb
ui_bibz-2.0.0.beta2.2 test/ui/core/notifications/alert_test.rb
ui_bibz-2.0.0.beta2.1 test/ui/core/notifications/alert_test.rb
ui_bibz-2.0.0.beta2 test/ui/core/notifications/alert_test.rb