Sha256: c0afee4f1c41b1fd47ec0323ce34e5aafc9b415d82ec93d6822f7b85ba55ac75
Contents?: true
Size: 581 Bytes
Versions: 19
Compression:
Stored size: 581 Bytes
Contents
require 'test_helper' class ReadableTest < MiniTest::Spec Credentials = Struct.new(:password) class PasswordForm < Reform::Form property :password, readable: false end let (:cred) { Credentials.new } let (:form) { PasswordForm.new(cred) } it { form.password.must_equal nil # password not read. form.validate("password" => "123") form.password.must_equal "123" form.sync cred.password.must_equal "123" # password written. hash = {} form.save do |nested| hash = nested end hash.must_equal("password"=> "123") } end
Version data entries
19 entries across 19 versions & 1 rubygems