Sha256: 549e17700aeb0ce2384a6f6563d72f76da559729f9a44fe2ca6b37b71cbeceb4

Contents?: true

Size: 501 Bytes

Versions: 14

Compression:

Stored size: 501 Bytes

Contents

require "test_helper"

class DefaultTest < Minitest::Spec
  Song  = Struct.new(:title, :album, :composer)
  Album = Struct.new(:name, :songs, :artist)
  Artist = Struct.new(:name)

  class AlbumForm < Reform::Form
    property :name, default: "Wrong"

    collection :songs do
      property :title, default: "It's Catching Up"
    end
  end

  it do
    form = AlbumForm.new(Album.new(nil, [Song.new]))

    form.name.must_equal "Wrong"
    form.songs[0].title.must_equal "It's Catching Up"
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
reform-2.2.4 test/default_test.rb
reform-2.2.3 test/default_test.rb
reform-2.2.2 test/default_test.rb
reform-2.2.1 test/default_test.rb
reform-2.2.0 test/default_test.rb
reform-2.2.0.rc1 test/default_test.rb
reform-2.1.0 test/default_test.rb
reform-2.1.0.rc1 test/default_test.rb
reform-2.0.5 test/default_test.rb
reform-2.0.4 test/default_test.rb
reform-2.0.3 test/default_test.rb
reform-2.0.2 test/default_test.rb
reform-2.0.1 test/default_test.rb
reform-2.0.0 test/default_test.rb