Sha256: 4198af49ec762854864725de36192339ed45f45e9f29e10ea4169c8944a9ebb2

Contents?: true

Size: 1.02 KB

Versions: 33

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

33 entries across 33 versions & 1 rubygems

Version Path
ui_bibz-4.0.0.beta16 test/ui/core/forms/choices/radio_field_test.rb
ui_bibz-4.0.0.beta15 test/ui/core/forms/choices/radio_field_test.rb
ui_bibz-4.0.0.beta14 test/ui/core/forms/choices/radio_field_test.rb
ui_bibz-4.0.0.beta13 test/ui/core/forms/choices/radio_field_test.rb
ui_bibz-4.0.0.beta10 test/ui/core/forms/choices/radio_field_test.rb
ui_bibz-4.0.0.beta9 test/ui/core/forms/choices/radio_field_test.rb
ui_bibz-4.0.0.beta8 test/ui/core/forms/choices/radio_field_test.rb
ui_bibz-4.0.0.beta7 test/ui/core/forms/choices/radio_field_test.rb
ui_bibz-4.0.0.beta6 test/ui/core/forms/choices/radio_field_test.rb
ui_bibz-4.0.0.beta4 test/ui/core/forms/choices/radio_field_test.rb
ui_bibz-4.0.0.beta3 test/ui/core/forms/choices/radio_field_test.rb
ui_bibz-3.0.13 test/ui/core/forms/choices/radio_field_test.rb
ui_bibz-3.0.12 test/ui/core/forms/choices/radio_field_test.rb
ui_bibz-3.0.11 test/ui/core/forms/choices/radio_field_test.rb
ui_bibz-3.0.10 test/ui/core/forms/choices/radio_field_test.rb
ui_bibz-3.0.9 test/ui/core/forms/choices/radio_field_test.rb
ui_bibz-3.0.8 test/ui/core/forms/choices/radio_field_test.rb
ui_bibz-3.0.7 test/ui/core/forms/choices/radio_field_test.rb
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