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-4.0.0.beta14 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-4.0.0.beta13 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-4.0.0.beta10 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-4.0.0.beta9 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-4.0.0.beta8 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-4.0.0.beta7 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-4.0.0.beta6 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-4.0.0.beta4 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-4.0.0.beta3 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-3.0.13 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-3.0.12 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-3.0.11 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-3.0.10 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-3.0.9 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-3.0.8 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-3.0.7 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-3.0.6 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-3.0.5 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-3.0.4 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-3.0.3 test/ui/core/forms/texts/text_field_test.rb