Sha256: a9e6768416d20631efb86352c1b538965399f752c1f71175f4073bc26f553e10
Contents?: true
Size: 499 Bytes
Versions: 6
Compression:
Stored size: 499 Bytes
Contents
require 'test_helper' class FormOptionTest < MiniTest::Spec Song = Struct.new(:title) Album = Struct.new(:song) class SongForm < Reform::Form property :title validation do key(:title).required end 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