Permalink
Browse files

Remove the obsolete ‘ObjectsSingleError’ test suite

  • Loading branch information...
Baggz committed Mar 7, 2012
1 parent f881ec4 commit 59f5ebb06d821850b3d19534fb35a80b6334b7b2
Showing with 0 additions and 176 deletions.
  1. +0 −176 tests/validators/required/objectsSingleError.js
@@ -1,176 +0,0 @@
-// Load dependencies
-var amanda = require('../../../dist/latest.js');
-
-var schema = {
- type: 'object',
- properties: {
- user: {
- type: 'object',
- properties: {
- name: {
- required: true
- },
- surname: {
- required: true
- }
- }
- }
- }
-};
-
-/**
- * Test #1
- */
-exports['Test #1'] = function(test) {
-
- var data = {
- user: {
- name: 'František',
- surname: 'Hába'
- }
- };
-
- amanda.validate(data, schema, function(error) {
-
- test.equal(error, undefined);
-
- });
-
- test.done();
-
-};
-
-exports['Test #2'] = function(test) {
-
- var data = {};
-
- amanda.validate(data, schema, function(error) {
-
- delete error[0].message;
-
- test.deepEqual(error[0], {
- property: 'user.name',
- propertyValue: undefined,
- validator: 'required',
- validatorValue: true
- });
-
- test.equal(error.length, 1);
-
- });
-
- test.done();
-
-};
-
-exports['Test #3'] = function(test) {
-
- var data = {
- user: 123
- };
-
- amanda.validate(data, schema, function(error) {
-
- delete error[0].message;
- delete error[1].message;
-
- test.deepEqual(error[0], {
- property: 'user',
- propertyValue: 123,
- validator: 'type',
- validatorValue: 'object'
- });
-
- test.deepEqual(error[1], {
- property: 'user.name',
- propertyValue: undefined,
- validator: 'required',
- validatorValue: true
- });
-
- test.equal(error.length, 2);
-
- });
-
- test.done();
-
-};
-
-exports['Test #4'] = function(test) {
-
- var data = {
- user: {}
- };
-
- amanda.validate(data, schema, function(error) {
-
- delete error[0].message;
-
- test.deepEqual(error[0], {
- property: 'user.name',
- propertyValue: undefined,
- validator: 'required',
- validatorValue: true
- });
-
- test.equal(error.length, 1);
-
- });
-
- test.done();
-
-};
-
-exports['Test #5'] = function(test) {
-
- var data = {
- user: {
- name: 'František'
- }
- };
-
- amanda.validate(data, schema, function(error) {
-
- delete error[0].message;
-
- test.deepEqual(error[0], {
- property: 'user.surname',
- propertyValue: undefined,
- validator: 'required',
- validatorValue: true
- });
-
- test.equal(error.length, 1);
-
- });
-
- test.done();
-
-};
-
-exports['Test #6'] = function(test) {
-
- var data = {
- user: {
- surname: 'Hába'
- }
- };
-
- amanda.validate(data, schema, function(error) {
-
- delete error[0].message;
-
- test.deepEqual(error[0], {
- property: 'user.name',
- propertyValue: undefined,
- validator: 'required',
- validatorValue: true
- });
-
- test.equal(error.length, 1);
-
- });
-
- test.done();
-
-};

0 comments on commit 59f5ebb

Please sign in to comment.