Ejemplo n.º 1
0
 it("should dispatch errors to callback", function(done) {
   findOne.yields("error");
   SM.getSet("some id xyzz", function(err, record) {
     err.should.eql("error");
     should.not.exist(record);
     done();
   });
 });
Ejemplo n.º 2
0
 it("should dispatch success to callback", function(done) {
   findOne.yields(null, "record");
   SM.getSet("some id xyzz", function(err, record) {
     should.not.exist(err);
     record.should.eql("record");
     done();
   });
 });
Ejemplo n.º 3
0
 it("should call findOne with the given record ID converted to an object id", function(done) {
   findOne.yields();
   SM.getSet("some id xyzz", function(err, record) {
     findOne.callCount.should.eql(1);
     var args = findOne.getCall(0).args;
     args[0].should.eql({ _id: DB.getObjID("some id xyzz") })
     done();
   });
 });