@dhyasama/totem-models 6.21.2 → 6.21.4

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": "6.21.2",
3
+ "version": "6.21.4",
4
4
  "author": "Jason Reynolds",
5
5
  "license": "UNLICENSED",
6
6
  "description": "Models for Totem platform",
@@ -15,8 +15,8 @@
15
15
  "@dhyasama/ffvc-crypto": "^1.0.0",
16
16
  "@dhyasama/ffvc-geoip": "^1.0.0",
17
17
  "@dhyasama/ffvc-s3": "^1.1.0",
18
- "@dhyasama/ffvc-utilities": "^2.6.2",
19
- "async": "^2.6.1",
18
+ "@dhyasama/ffvc-utilities": "^2.6.3",
19
+ "async": "^2.6.2",
20
20
  "awesome-phonenumber": "^1.0.14",
21
21
  "bcrypt": "^0.8.0",
22
22
  "bluebird": "^3.5.3",
@@ -75,6 +75,9 @@ describe('Organization', function() {
75
75
  org2.aliases.push('NT2');
76
76
  org2.crunchbase.uuid = 'abc';
77
77
  org2.crunchbase.url = 'abc';
78
+ org2.social.facebook = 'https://facebook.com/abc';
79
+ org2.social.linkedin = 'http://www.linkedin.com/in/abc';
80
+ org2.social.twitter = 'twitter.com/abc';
78
81
 
79
82
  org3 = new Organization();
80
83
  org3.name = 'Fudge 3';
@@ -889,6 +892,69 @@ describe('Organization', function() {
889
892
  });
890
893
  });
891
894
 
895
+ it('finds orgs by twitter with http and no www', function (done) {
896
+ Organization.findBySocial('http://twitter.com/abc', function (err, result) {
897
+ should.not.exist(err);
898
+ should.exist(result);
899
+ result.length.should.equal(1);
900
+ return done();
901
+ });
902
+ });
903
+
904
+ it('finds orgs by twitter with https and no www', function (done) {
905
+ Organization.findBySocial('https://twitter.com/abc', function (err, result) {
906
+ should.not.exist(err);
907
+ should.exist(result);
908
+ result.length.should.equal(1);
909
+ return done();
910
+ });
911
+ });
912
+
913
+ it('finds orgs by twitter with http and www', function (done) {
914
+ Organization.findBySocial('http://www.twitter.com/abc', function (err, result) {
915
+ should.not.exist(err);
916
+ should.exist(result);
917
+ result.length.should.equal(1);
918
+ return done();
919
+ });
920
+ });
921
+
922
+ it('finds orgs by twitter with https and www', function (done) {
923
+ Organization.findBySocial('https://www.twitter.com/abc', function (err, result) {
924
+ should.not.exist(err);
925
+ should.exist(result);
926
+ result.length.should.equal(1);
927
+ return done();
928
+ });
929
+ });
930
+
931
+ it('finds orgs by twitter with no http, https or www', function (done) {
932
+ Organization.findBySocial('twitter.com/abc', function (err, result) {
933
+ should.not.exist(err);
934
+ should.exist(result);
935
+ result.length.should.equal(1);
936
+ return done();
937
+ });
938
+ });
939
+
940
+ it('finds orgs by facebook with http and no www', function (done) {
941
+ Organization.findBySocial('http://facebook.com/abc', function (err, result) {
942
+ should.not.exist(err);
943
+ should.exist(result);
944
+ result.length.should.equal(1);
945
+ return done();
946
+ });
947
+ });
948
+
949
+ it('finds orgs by linkedin with http and no www', function (done) {
950
+ Organization.findBySocial('http://linkedin.com/company/abc', function (err, result) {
951
+ should.not.exist(err);
952
+ should.exist(result);
953
+ result.length.should.equal(1);
954
+ return done();
955
+ });
956
+ });
957
+
892
958
  it('finds orgs by ids', function (done) {
893
959
  Organization.findByIds([org4._id, org5._id], function (err, result) {
894
960
  should.not.exist(err);
package/test/Person.js CHANGED
@@ -139,7 +139,11 @@ describe('Person', function() {
139
139
  person3.slug = 'person3-slug';
140
140
  person3.related.push(person2.id);
141
141
  person3.aliases.push('Slippery Pete');
142
-
142
+ person3.social = {
143
+ facebook: 'facebook.com/slipperypete',
144
+ linkedin: 'http://www.linkedin.com/in/slipperypete',
145
+ twitter: 'https://twitter.com/slipperypete'
146
+ };
143
147
  person3.contact.email.push({
144
148
  type: 'work',
145
149
  email: 'paul@ffvc.com',
@@ -657,6 +661,88 @@ describe('Person', function() {
657
661
 
658
662
  });
659
663
 
664
+
665
+
666
+
667
+
668
+ it('finds person by facebook with http and no www', function (done) {
669
+ Person.findBySocial('http://facebook.com/slipperypete', function (err, result) {
670
+ should.not.exist(err);
671
+ should.exist(result);
672
+ result.length.should.equal(1);
673
+ result[0].slug.should.equal('person3-slug');
674
+ return done();
675
+ });
676
+ });
677
+
678
+ it('finds person by facebook with https and no www', function (done) {
679
+ Person.findBySocial('https://facebook.com/slipperypete', function (err, result) {
680
+ should.not.exist(err);
681
+ should.exist(result);
682
+ result.length.should.equal(1);
683
+ result[0].slug.should.equal('person3-slug');
684
+ return done();
685
+ });
686
+ });
687
+
688
+ it('finds person by facebook with http and www', function (done) {
689
+ Person.findBySocial('http://www.facebook.com/slipperypete', function (err, result) {
690
+ should.not.exist(err);
691
+ should.exist(result);
692
+ result.length.should.equal(1);
693
+ result[0].slug.should.equal('person3-slug');
694
+ return done();
695
+ });
696
+ });
697
+
698
+ it('finds person by facebook with https and www', function (done) {
699
+ Person.findBySocial('https://www.facebook.com/slipperypete', function (err, result) {
700
+ should.not.exist(err);
701
+ should.exist(result);
702
+ result.length.should.equal(1);
703
+ result[0].slug.should.equal('person3-slug');
704
+ return done();
705
+ });
706
+ });
707
+
708
+ it('finds person by facebook with no http, https or www', function (done) {
709
+ Person.findBySocial('facebook.com/slipperypete', function (err, result) {
710
+ should.not.exist(err);
711
+ should.exist(result);
712
+ result.length.should.equal(1);
713
+ result[0].slug.should.equal('person3-slug');
714
+ return done();
715
+ });
716
+ });
717
+
718
+ it('finds person by twitter with http and no www', function (done) {
719
+ Person.findBySocial('http://twitter.com/slipperypete', function (err, result) {
720
+ should.not.exist(err);
721
+ should.exist(result);
722
+ result.length.should.equal(1);
723
+ result[0].slug.should.equal('person3-slug');
724
+ return done();
725
+ });
726
+ });
727
+
728
+ it('finds person by linkedin with http and no www', function (done) {
729
+ Person.findBySocial('http://linkedin.com/in/slipperypete', function (err, result) {
730
+ should.not.exist(err);
731
+ should.exist(result);
732
+ result.length.should.equal(1);
733
+ result[0].slug.should.equal('person3-slug');
734
+ return done();
735
+ });
736
+ });
737
+
738
+
739
+
740
+
741
+
742
+
743
+
744
+
745
+
660
746
  it('finds person by slug', function(done) {
661
747
 
662
748
  Person.findBySlug('person3-slug', function(err, p) {