Sha256: e6e8df3888ad158b96ebde7f12fcfb4ee3997b5d8e716c7f21b1eddc635a2025

Contents?: true

Size: 925 Bytes

Versions: 2

Compression:

Stored size: 925 Bytes

Contents

var root;

root = typeof exports !== "undefined" && exports !== null ? exports : window;

require('indemma/lib/record/validatable.js');

describe('model #() validates_cpf_format', function() {
  return describe('basic usage', function() {
    var model;

    model = root.model;
    beforeEach(function() {
      return this.person = model.call({
        resource: 'person',
        cpf: String,
        validates_cpf_format: 'cpf'
      });
    });
    afterEach(function() {
      return this.person.validators.length = 0;
    });
    return describe('#validate', function() {
      return it('should add error to record when fields is in invalid format', function() {
        var arthur;

        arthur = this.person({
          cpf: '871.95FRANGO-00'
        });
        arthur.valid;
        return arthur.errors.messages.should.have.deep.property('cpf', "O campo cpf não está válido.");
      });
    });
  });
});

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ende-0.5.22 components/indefinido/indemma/master/spec/record/validations/cpf_spec.js
ende-0.5.21 components/indefinido/indemma/master/spec/record/validations/cpf_spec.js