Sha256: 6f61cf4bb54b2735d97509874fdcfb747845111268e39a7f187925cb02b94d7b

Contents?: true

Size: 1.14 KB

Versions: 51

Compression:

Stored size: 1.14 KB

Contents

# frozen_string_literal: true

require 'test_helper'

class TextFieldTest < ActionView::TestCase
  test 'text_field without prepend and append' do
    actual = UiBibz::Ui::Core::Forms::Texts::TextField.new('test').render
    expected = '<input type="text" name="test" id="test" class="form-control" />'

    assert_equal expected, actual
  end

  test 'text_field with prepend and append' do
    actual = UiBibz::Ui::Core::Forms::Texts::TextField.new('test', append: '1', prepend: '2').render
    expected = '<div class="input-group ui_surround_field"><span class="input-group-text">1</span><input type="text" name="test" id="test" class="form-control" /><span class="input-group-text">2</span></div>'

    assert_equal expected, actual
  end

  test 'text_field size' do
    actual = UiBibz::Ui::Core::Forms::Texts::TextField.new('test', size: :xs, append: '1', prepend: '2').render
    expected = '<div class="input-group-xs input-group ui_surround_field"><span class="input-group-text">1</span><input type="text" name="test" id="test" class="form-control form-control-xs" /><span class="input-group-text">2</span></div>'

    assert_equal expected, actual
  end
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
ui_bibz-3.0.2 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-3.0.1 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-3.0.0 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-3.0.0.beta19 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-3.0.0.beta18 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-3.0.0.beta17 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-3.0.0.beta16 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-3.0.0.beta15 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-3.0.0.beta14 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-3.0.0.beta13 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-3.0.0.beta12 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-3.0.0.beta11 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-3.0.0.beta10 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-3.0.0.beta9 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-3.0.0.beta8 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-3.0.0.beta7 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-3.0.0.beta6 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-3.0.0.beta5 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-3.0.0.beta4 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-3.0.0.beta3 test/ui/core/forms/texts/text_field_test.rb