Sha256: 8564cd14d6597aa728764de88c68cbd95abdda1f04b1688ab1f19d0074d1639e

Contents?: true

Size: 1.02 KB

Versions: 2

Compression:

Stored size: 1.02 KB

Contents

var root;

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

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

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

    model = root.model;
    person = null;
    beforeEach(function() {
      return person = model.call({
        resource: 'person',
        password: String,
        validates_confirmation_of: 'password'
      });
    });
    afterEach(function() {
      return person.validators.length = 0;
    });
    return describe('#validate', function() {
      return it('should add error to record when fields does not match', function() {
        var arthur;

        arthur = person({
          password: "domo",
          password_confirmation: "kun"
        });
        arthur.valid;
        return 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/spec/record/validations/confirmation_spec.js
ende-0.5.21 components/indefinido/indemma/master/spec/record/validations/confirmation_spec.js