Sha256: 482203636ef114fad9948aabe37bae9e62ba66608e0970007f51e19204e93d0f

Contents?: true

Size: 557 Bytes

Versions: 7

Compression:

Stored size: 557 Bytes

Contents

require 'test_helper'

class ComponentTest < ActionView::TestCase

  test 'create complex component' do
    actual = UiBibz::Ui::Core::Component.new('New component', { state: :active, glyph: 'add' }, { class: 'new-class' }).render
    expected = '<i class="glyph fa fa-add"></i> New component'

    assert_equal expected, actual
  end

  test 'create complex component with block' do
    actual = UiBibz::Ui::Core::Component.new(state: :active) do
      "New content"
    end.render
    expected = 'New content'

    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/component_test.rb
ui_bibz-2.0.0.beta2.5 test/ui/core/component_test.rb
ui_bibz-2.0.0.beta2.4 test/ui/core/component_test.rb
ui_bibz-2.0.0.beta2.3 test/ui/core/component_test.rb
ui_bibz-2.0.0.beta2.2 test/ui/core/component_test.rb
ui_bibz-2.0.0.beta2.1 test/ui/core/component_test.rb
ui_bibz-2.0.0.beta2 test/ui/core/component_test.rb