Sha256: b0bea0d4738899279dfda7428b2fbff994c532459d04de31d4bcf2c07a73139a

Contents?: true

Size: 1.18 KB

Versions: 37

Compression:

Stored size: 1.18 KB

Contents

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-addon\">1</span><input type=\"text\" name=\"test\" id=\"test\" class=\"form-control\" /><span class=\"input-group-addon\">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-addon\">1</span><input type=\"text\" name=\"test\" id=\"test\" class=\"form-control form-control-xs\" /><span class=\"input-group-addon\">2</span></div>"

      assert_equal expected, actual
    end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
ui_bibz-2.4.0 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-2.3.15 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-2.3.14 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-2.3.13 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-2.3.12 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-2.3.11 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-2.3.10 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-2.3.9 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-2.3.8 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-2.3.7 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-2.3.6 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-2.3.5 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-2.3.4 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-2.3.3 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-2.3.2 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-2.3.1 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-2.3.0 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-2.2.2 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-2.2.1 test/ui/core/forms/texts/text_field_test.rb
ui_bibz-2.2.0 test/ui/core/forms/texts/text_field_test.rb