Sha256: 4198af49ec762854864725de36192339ed45f45e9f29e10ea4169c8944a9ebb2

Contents?: true

Size: 1.02 KB

Versions: 35

Compression:

Stored size: 1.02 KB

Contents

# frozen_string_literal: true

require 'test_helper'

class RadioFieldTest < ActionView::TestCase
  test 'radio_field' do
    actual = UiBibz::Ui::Core::Forms::Choices::RadioField.new('John', { value: 1, status: :primary, type: :square }).render
    expected = "<div class=\"form-check\"><input type=\"radio\" name=\"John\" id=\"John_1\" value=\"1\" class=\"form-check-input form-check-input-primary\" /><label class=\"form-check-label\" for=\"John_1\">John</label></div>"

    assert_equal expected, actual
  end

  test 'checkbox_field with options and html_options' do
    actual = UiBibz::Ui::Core::Forms::Choices::RadioField.new('John', action: 'click->controller#action', label_html: { class: 'test' }, wrapper_html: { title: "My title" }).render
    expected = "<div title=\"My title\" class=\"form-check\"><input type=\"radio\" name=\"John\" id=\"John_\" data-action=\"click-&gt;controller#action\" class=\"form-check-input\" /><label class=\"form-check-label\" for=\"John_\">John</label></div>"

    assert_equal expected, actual
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
ui_bibz-3.0.6 test/ui/core/forms/choices/radio_field_test.rb
ui_bibz-3.0.5 test/ui/core/forms/choices/radio_field_test.rb
ui_bibz-3.0.4 test/ui/core/forms/choices/radio_field_test.rb
ui_bibz-3.0.3 test/ui/core/forms/choices/radio_field_test.rb
ui_bibz-3.0.2 test/ui/core/forms/choices/radio_field_test.rb
ui_bibz-3.0.1 test/ui/core/forms/choices/radio_field_test.rb
ui_bibz-3.0.0 test/ui/core/forms/choices/radio_field_test.rb
ui_bibz-3.0.0.beta19 test/ui/core/forms/choices/radio_field_test.rb
ui_bibz-3.0.0.beta18 test/ui/core/forms/choices/radio_field_test.rb
ui_bibz-3.0.0.beta17 test/ui/core/forms/choices/radio_field_test.rb
ui_bibz-3.0.0.beta16 test/ui/core/forms/choices/radio_field_test.rb
ui_bibz-3.0.0.beta15 test/ui/core/forms/choices/radio_field_test.rb
ui_bibz-3.0.0.beta14 test/ui/core/forms/choices/radio_field_test.rb
ui_bibz-3.0.0.beta13 test/ui/core/forms/choices/radio_field_test.rb
ui_bibz-3.0.0.beta12 test/ui/core/forms/choices/radio_field_test.rb