Sha256: 9815028426b1e3f2aef969afa31280ac37492589dacdbd4db7cc3c2442d77739

Contents?: true

Size: 741 Bytes

Versions: 2

Compression:

Stored size: 741 Bytes

Contents

root = exports ? window

require 'indemma/lib/record/validatable.js'

describe 'model #() validates_confirmation_of',  ->

  describe 'basic usage', ->
    model  = root.model
    person = null

    beforeEach ->
      person = model.call
        resource : 'person'
        password : String
        validates_confirmation_of: 'password'

    afterEach ->
      person.validators.length = 0

    describe '#validate', ->

      it 'should add error to record when fields does not match', ->
        arthur = person password: "domo", password_confirmation: "kun"
        arthur.valid
        arthur.errors.messages.should.have.deep.property 'password_confirmation', 'O campo password não está de acordo com o campo password_confirmation.'

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ende-0.5.22 components/indefinido/indemma/master/src/spec/record/validations/confirmation_spec.coffee
ende-0.5.21 components/indefinido/indemma/master/src/spec/record/validations/confirmation_spec.coffee