Sha256: 82f768fc07ffb0309a4ce209b7abb1bca49da76d5c2cf4504bf121475cb21a56
Contents?: true
Size: 1.24 KB
Versions: 6
Compression:
Stored size: 1.24 KB
Contents
# frozen_string_literal: true require 'test_helper' class SelectFieldTest < ActionView::TestCase test 'Select Field' do options = options_for_select(2.times.map { |i| "option #{i}" }) actual = UiBibz::Ui::Core::Forms::Selects::SelectField.new('example', option_tags: options).render expected = "<select name=\"example\" id=\"example\" class=\"select-field form-control custom-select\"><option value=\"option 0\">option 0</option> <option value=\"option 1\">option 1</option></select>" assert_equal expected, actual end test 'Select Field refresh' do actual = UiBibz::Ui::Core::Forms::Selects::SelectField.new('example', refresh: { target: { url: '/' } }).render expected = '<div class="field-refresh input-group ui_surround_field"><select name="example" id="example" class="select-field form-control custom-select"></select><div class="input-group-btn"><span data-connect="{"events":"click","mode":"remote","target":{"selector":"#example","url":"/","data":[]}}" class="btn-secondary ui-bibz-connect btn input-refresh-button"><i class="glyph fas fa-sync-alt"></i> </span></div></div>' assert_equal expected, actual end end
Version data entries
6 entries across 6 versions & 1 rubygems