Sha256: 40aab00bce6e77804f0d04f40b7e2c01f5d7e07306541b7dcc50859e6b18db4e

Contents?: true

Size: 759 Bytes

Versions: 50

Compression:

Stored size: 759 Bytes

Contents

root = exports ? window

require 'indemma/lib/record/validatable'

describe 'model #() validates_cpf_format',  ->

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

    beforeEach ->
      person = model.call
        resource : 'person'
        cpf      : String
        validates_cpf_format: 'cpf'

    afterEach ->
      # Clear validators from resource
      person?.validators.length = 0

    describe '#validate', ->

      it 'should add error to record when fields is in invalid format', ->
        arthur = person cpf: '871.943.417-00'
        arthur.valid

        # TODO figure out why the heck the validators aren't being reset
        arthur.errors.messages.should.have.deep.property 'cpf', "O campo cpf não está válido."

Version data entries

50 entries across 50 versions & 1 rubygems

Version Path
ende-0.5.1 components/indefinido/indemma/master/src/spec/record/validations/cpf_spec.coffee
ende-0.4.18 vendor/components/indefinido-indemma/src/spec/record/validations/cpf_spec.coffee
ende-0.4.17 vendor/components/indefinido-indemma/src/spec/record/validations/cpf_spec.coffee
ende-0.4.16 vendor/components/indefinido-indemma/src/spec/record/validations/cpf_spec.coffee
ende-0.3.13 vendor/components/indefinido-indemma/src/spec/record/validations/cpf_spec.coffee
ende-0.3.12 vendor/components/indefinido-indemma/src/spec/record/validations/cpf_spec.coffee
ende-0.3.11 vendor/components/indefinido-indemma/src/spec/record/validations/cpf_spec.coffee
ende-0.4.15 vendor/components/indefinido-indemma/src/spec/record/validations/cpf_spec.coffee
ende-0.4.14 vendor/components/indefinido-indemma/src/spec/record/validations/cpf_spec.coffee
ende-0.4.13 vendor/components/indefinido-indemma/src/spec/record/validations/cpf_spec.coffee
ende-0.4.12 vendor/components/indefinido-indemma/src/spec/record/validations/cpf_spec.coffee
ende-0.4.11 vendor/components/indefinido-indemma/src/spec/record/validations/cpf_spec.coffee
ende-0.4.10 vendor/components/indefinido-indemma/src/spec/record/validations/cpf_spec.coffee
ende-0.4.9 vendor/components/indefinido-indemma/src/spec/record/validations/cpf_spec.coffee
ende-0.4.8 vendor/components/indefinido-indemma/src/spec/record/validations/cpf_spec.coffee
ende-0.4.7 vendor/components/indefinido-indemma/src/spec/record/validations/cpf_spec.coffee
ende-0.4.6 vendor/components/indefinido-indemma/src/spec/record/validations/cpf_spec.coffee
ende-0.4.5 vendor/components/indefinido-indemma/src/spec/record/validations/cpf_spec.coffee
ende-0.4.4 vendor/components/indefinido-indemma/src/spec/record/validations/cpf_spec.coffee
ende-0.4.3 vendor/components/indefinido-indemma/src/spec/record/validations/cpf_spec.coffee