@dhyasama/totem-models 5.7.0 → 5.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhyasama/totem-models",
3
- "version": "5.7.0",
3
+ "version": "5.8.0",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",
package/test/Message.js CHANGED
@@ -50,8 +50,13 @@ describe('Message', function() {
50
50
  Message.upsert(message, function(err, result) {
51
51
  should.not.exist(err);
52
52
  should.exist(result);
53
+
54
+ result.createdOn.should.equal(result.updatedOn);
55
+
53
56
  messageOne = result;
57
+
54
58
  done();
59
+
55
60
  });
56
61
 
57
62
  });
@@ -303,4 +308,24 @@ describe('Message', function() {
303
308
 
304
309
  });
305
310
 
311
+ it('updates a message', function(done) {
312
+
313
+ var orgid = new mongoose.Types.ObjectId();
314
+
315
+ messageOne.organization = orgid;
316
+
317
+ Message.upsert(messageOne, function(err, result) {
318
+
319
+ should.not.exist(err);
320
+ should.exist(result);
321
+
322
+ result.organization.should.equal(orgid);
323
+ result.createdOn.should.not.equal(result.updatedOn);
324
+
325
+ return done();
326
+
327
+ });
328
+
329
+ });
330
+
306
331
  });
package/test/Person.js CHANGED
@@ -515,6 +515,45 @@ describe('Person', function() {
515
515
 
516
516
  });
517
517
 
518
+ it('searches by email', function(done) {
519
+
520
+ Person.searchByEmail('dhyasama+test@gmail.com', function(err, result) {
521
+
522
+ should.not.exist(err);
523
+ should.exist(result);
524
+ result.length.should.equal(1);
525
+ done();
526
+
527
+ });
528
+
529
+ });
530
+
531
+ it('searches by empty string email', function(done) {
532
+
533
+ Person.searchByEmail('', function(err, result) {
534
+
535
+ should.exist(err);
536
+ should.not.exist(result);
537
+
538
+ done();
539
+
540
+ });
541
+
542
+ });
543
+
544
+ it('searches by null email', function(done) {
545
+
546
+ Person.searchByEmail(null, function(err, result) {
547
+
548
+ should.exist(err);
549
+ should.not.exist(result);
550
+
551
+ done();
552
+
553
+ });
554
+
555
+ });
556
+
518
557
  });
519
558
 
520
559
  it('finds dupes with separate first and last search', function(done) {