Sha256: 34922b5012ee7089eb55fed7b6b5d6222fa668c14512ce3d1698d503c4e01dba

Contents?: true

Size: 483 Bytes

Versions: 6

Compression:

Stored size: 483 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
    form = AlbumForm.new(Album.new(Song.new("When It Comes To You")))
    form.song.title.must_equal "When It Comes To You"

    form.validate(song: {title: "Run For Cover"})
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
reform-2.1.0 test/form_option_test.rb
reform-2.1.0.rc1 test/form_option_test.rb
reform-2.0.5 test/form_option_test.rb
reform-2.0.4 test/form_option_test.rb
reform-2.0.3 test/form_option_test.rb
reform-2.0.2 test/form_option_test.rb