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