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=\"{&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-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

Version Path
ui_bibz-2.0.0.beta2.2 test/ui/core/forms/selects/select_field_test.rb
ui_bibz-2.0.0.beta2.1 test/ui/core/forms/selects/select_field_test.rb
ui_bibz-2.0.0.beta2 test/ui/core/forms/selects/select_field_test.rb