Sha256: 3471e8347b07e327d345ce9156c9b8c3bea97ac56e99e3bb473e236a1e190ff7
Contents?: true
Size: 1.2 KB
Versions: 3
Compression:
Stored size: 1.2 KB
Contents
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\"><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\"><select name=\"example\" id=\"example\" class=\"select-field form-control\"></select><div class=\"input-group-btn\"><span data-connect=\"{"events":"click","mode":"remote","target":{"selector":"#example","url":"/","data":[]}}\" class=\"btn-primary ui-bibz-connect btn input-refresh-button\"><i class=\"glyph fa fa-refresh\"></i> </span></div></div>" assert_equal expected, actual end end
Version data entries
3 entries across 3 versions & 1 rubygems