Sha256: b3a4d9f536853ee0eb1f9a0462489d69398b38479a6cf6c8d82b4b6683d36acc

Contents?: true

Size: 1.25 KB

Versions: 17

Compression:

Stored size: 1.25 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 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=\"{&quot;events&quot;:&quot;click&quot;,&quot;mode&quot;:&quot;remote&quot;,&quot;target&quot;:{&quot;selector&quot;:&quot;#example&quot;,&quot;url&quot;:&quot;/&quot;,&quot;data&quot;:[]}}\" 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

17 entries across 17 versions & 1 rubygems

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