Sha256: a7e3010cba855367525632055a42fb73f639ac7deb5f8a0d421e6c891dcdec29

Contents?: true

Size: 416 Bytes

Versions: 4

Compression:

Stored size: 416 Bytes

Contents

require 'test_helper'

class FormOptionTest < MiniTest::Spec
  Song  = Struct.new(:title)
  Album = Struct.new(:song)

  class SongForm < Reform::Form
    property :title
    validates :title, presence: true
  end

  class AlbumForm < Reform::Form
    property :song, form: SongForm
  end

  it do
    AlbumForm.new(Album.new(Song.new("When It Comes To You"))).song.title.must_equal "When It Comes To You"
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
reform-2.0.1 test/form_option_test.rb
reform-2.0.0 test/form_option_test.rb
reform-2.0.0.rc3 test/form_option_test.rb
reform-2.0.0.rc2 test/form_option_test.rb