Sha256: 0b6df60316fc4da8fa94b08bbe61acfc7f87f73ad620bd98c9a2f66814221ccb

Contents?: true

Size: 1.01 KB

Versions: 4

Compression:

Stored size: 1.01 KB

Contents

var root;

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

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

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', "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/spec/record/validations/confirmation_spec.js
ende-0.2.2 vendor/components/indefinido-indemma/spec/record/validations/confirmation_spec.js
ende-0.2.1 vendor/components/indefinido-indemma/spec/record/validations/confirmation_spec.js
ende-0.2.0 vendor/components/indefinido-indemma/spec/record/validations/confirmation_spec.js