Sha256: a6c2577285ad125ebf616cccd6c3c56744a82fd3b7470ddefeda56192052f5c0

Contents?: true

Size: 848 Bytes

Versions: 3

Compression:

Stored size: 848 Bytes

Contents

require 'test_helper'

require 'test_helper'
require 'reform/twin'

# class TwinTest < MiniTest::Spec
#   class SongForm < Reform::Form
#     class Twin < Disposable::Twin
#       property :title
#       option :is_online # TODO: this should make it read-only in reform!
#     end

#     # include Reform::Twin
#     # twin Twin
#   end

#   let (:model) { OpenStruct.new(title: "Kenny") }

#   let (:form) { SongForm.new(model, is_online: true) }

#   it { form.title.must_equal "Kenny" }
#   it { form.is_online.must_equal true }
# end
class TwinTest < MiniTest::Spec
  Song = Struct.new(:name)

  class SongForm < Reform::Form
    property :name
    property :is_online, virtual: true
  end

  let (:form) { SongForm.new(Song.new("Kenny"), is_online: true) }

  it do
    form.name.must_equal "Kenny"
    form.is_online.must_equal true
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
reform-2.0.0.rc3 test/twin_test.rb
reform-2.0.0.rc2 test/twin_test.rb
reform-2.0.0.rc1 test/twin_test.rb