Sha256: a58d978c4aa7a12beae1b91af2b316a9dff707018a794a6fac7709612b957b8c

Contents?: true

Size: 732 Bytes

Versions: 4

Compression:

Stored size: 732 Bytes

Contents

root = exports ? window

require 'indemma/lib/record/validatable'

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', "O campo password não está diacordo com a confirmação password_confirmation."

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ende-0.2.3 vendor/components/indefinido-indemma/src/spec/record/validations/confirmation_spec.coffee
ende-0.2.2 vendor/components/indefinido-indemma/src/spec/record/validations/confirmation_spec.coffee
ende-0.2.1 vendor/components/indefinido-indemma/src/spec/record/validations/confirmation_spec.coffee
ende-0.2.0 vendor/components/indefinido-indemma/src/spec/record/validations/confirmation_spec.coffee