Ejemplo n.º 1
0
 'should occur `error` event': function (err, topic) {
   assert.instanceOf(err, Error);
   assert.isUndefined(topic);
 },
 'should next with error' : function(err, req, res, e) {
   assert.instanceOf(e, Error);
   assert.equal(e.message, 'Invalid OAuth 2.0 session key.');
 },
Ejemplo n.º 3
0
function assertMail (transport) {
  assert.instanceOf(transport, Mail);
  assert.isFunction(transport.log);
}
Ejemplo n.º 4
0
					" all records should be updated" : function(emp) {
						assert.instanceOf(emp, Employee2);
						assert.equal(emp.firstname, "dougie2");
						helper.dropModels();
					}
 'should next with error' : function(err, req, res, e) {
   assert.instanceOf(e, Error);
 },
Ejemplo n.º 6
0
					"and return employee with id of 21" : function(topic) {
						assert.instanceOf(topic, Employee2);
						assert.equal(10, topic.id);
					}
Ejemplo n.º 7
0
							" with the new name" : function(emp) {
								assert.instanceOf(emp, Employee2);
								assert.isNumber(emp.id);
								assert.equal(emp.firstname, "doug2");
							},
Ejemplo n.º 8
0
 'should call error' : function(err, e) {
   assert.isNotNull(e);
   assert.instanceOf(e, Error);
 },
Ejemplo n.º 9
0
 'should pass BadReqestError as additional info' : function(err, info) {
   assert.instanceOf(info, Error);
   assert.instanceOf(info, BadRequestError);
 },
Ejemplo n.º 10
0
 'should expose the JSLint edition': function (err, jslint) {
   assert.isString(jslint.edition);
   assert.matches(jslint.edition, /\d{4}-\d{2}-\d{2}/);
   // should throw on malformed dates
   assert.instanceOf(new Date(jslint.edition), Date);
 }
Ejemplo n.º 11
0
 'should error authentication' : function(err, e) {
   assert.instanceOf(e, Error);
   assert.instanceOf(e, VerificationError);
   assert.equal(e.message, 'need assertion and audience');
 },
Ejemplo n.º 12
0
 "should be respond with a single token literal": function (tokens) {
   assert.instanceOf(tokens, Array);
   assert.equal(tokens.length, 4);
 }
Ejemplo n.º 13
0
 topic:function (employee) {
     var works = employee.works;
     assert.instanceOf(works, Promise);
     works.then(hitch(this, "callback", null), hitch(this, "callback"));
 },
Ejemplo n.º 14
0
 "employee should be null but employee should still exists but not work anywhere":function (res) {
     assert.isNull(res.emp);
     assert.instanceOf(res.employee, Employee);
     assert.isNull(res.nullWorks);
 }
Ejemplo n.º 15
0
						topic.forEach(function(e, i) {
							assert.instanceOf(e, Employee2);
							assert.equal(i + 1, e.id);
						});
Ejemplo n.º 16
0
 "should instaniate the correct store": function () {
   nconf.use('memory');
   nconf.load();
   assert.instanceOf(nconf.stores['memory'], nconf.Memory);
 }
Ejemplo n.º 17
0
					"and return 6 employees" : function(topic) {
						var ids = [1,2,3,4,5,6];
						assert.instanceOf(topic, Employee2);
						assert.isTrue(ids.indexOf(topic.id) != -1);
					}
Ejemplo n.º 18
0
 'can\'t create under /etc': function (err, result) {
   result = result; // ugly workaround for jshint + vows
   Assert.instanceOf(err, Error);
   Assert.equal(err.code, 'EACCES');
 }
Ejemplo n.º 19
0
					"and the employee should have an id" : function(emp) {
						assert.instanceOf(emp, Employee2);
						assert.isNumber(emp.id);
					},
Ejemplo n.º 20
0
					"and return employee with id of 1" : function(topic) {
						assert.instanceOf(topic, Employee);
						assert.equal(topic.id, 6);
					}
Ejemplo n.º 21
0
					" all records should be updated" : function(emp) {
						assert.instanceOf(emp, Employee);
						assert.equal(emp.firstname, "dougie");
					}
Ejemplo n.º 22
0
						topic.forEach(function(t) {
							assert.instanceOf(t, Employee2);
							assert.equal(i++, t.id);
						});
 'should next with error' : function(err, req, res, e) {
   assert.instanceOf(e, Error);
   assert.equal(e.constructor.name, 'AuthorizationError');
   assert.equal(e.code, 'unauthorized_client');
 },
Ejemplo n.º 24
0
						topic.forEach(function(emp) {
							assert.instanceOf(emp, Employee2);
							assert.equal("F", emp.gender);
						});
 'should next with error' : function(err, req, res, e) {
   assert.instanceOf(e, Error);
   assert.equal(e.message, 'OAuth 2.0 server requires session support.');
 },
Ejemplo n.º 26
0
						topic.forEach(function(e) {
							assert.instanceOf(e, Employee2);
						});
Ejemplo n.º 27
0
 emp.save().then(function () {
     assert.instanceOf(emp.works, Works);
     next();
 }, next);
Ejemplo n.º 28
0
					"and return 21 employees" : function(topic) {
						assert.instanceOf(topic, Employee2);
						assert.equal(this.count++, topic.id);
					}
Ejemplo n.º 29
0
 'should pass error to next middleware' : function(err, req, res, e) {
   assert.instanceOf(e, Error);
   assert.equal(e.message, 'something went wrong');
 },
Ejemplo n.º 30
0
 'should return Agent object': function (agent) {
   assert.instanceOf(agent, Agent);
 }