@tiledesk/tiledesk-server 2.9.13 → 2.9.14

Sign up to get free protection for your applications and to get access to all the features.
package/routes/project.js CHANGED
@@ -941,7 +941,6 @@ router.get('/:projectid/users/availables', async (req, res) => {
941
941
  }
942
942
 
943
943
  query.id_user = { $in: group.members.map(id => mongoose.Types.ObjectId(id) )}
944
-
945
944
  }
946
945
  }
947
946
 
@@ -967,8 +966,15 @@ router.get('/:projectid/users/availables', async (req, res) => {
967
966
 
968
967
  available_agents_array = [];
969
968
  available_agents.forEach(agent => {
969
+ //console.log("agent: ", agent);
970
970
  if (agent.id_user) {
971
- available_agents_array.push({ "id": agent.id_user._id, "firstname": agent.id_user.firstname });
971
+ available_agents_array.push({
972
+ "id": agent.id_user._id,
973
+ "pu_id": agent._id,
974
+ "fullname": agent.id_user.firstname + " " + agent.id_user.lastname,
975
+ "email": agent.id_user.email,
976
+ "assigned_request": agent.number_assigned_requests
977
+ });
972
978
  } else {
973
979
  winston.warn("(Users Availables) agent.id_user is undefined");
974
980
  }
@@ -7,7 +7,7 @@ var userService = require('../services/userService');
7
7
  var faqService = require('../services/faqService');
8
8
 
9
9
  let chatbot_mock = require('./chatbot-mock');
10
- let log = false;
10
+ let log = true;
11
11
 
12
12
 
13
13
  //Require the dev-dependencies
@@ -244,9 +244,7 @@ describe('FaqKBRoute', () => {
244
244
  .auth(email, pwd)
245
245
  .send({ "name": "testbot", type: "internal", template: "blank" })
246
246
  .end((err, res) => {
247
- if (log) {
248
- }
249
- console.log("res.body", res.body);
247
+ if (log) { console.log("res.body", res.body); }
250
248
  res.should.have.status(200);
251
249
  res.body.should.be.a('object');
252
250
  expect(res.body.name).to.equal("testbot");
@@ -256,9 +254,7 @@ describe('FaqKBRoute', () => {
256
254
  .get('/' + savedProject._id + '/faq?id_faq_kb=' + id_faq_kb)
257
255
  .auth(email, pwd)
258
256
  .end((err, res) => {
259
- if (log) {
260
- }
261
- console.log("faq_list: ", JSON.stringify(res.body, null, 2));
257
+ if (log) { console.log("faq_list: ", JSON.stringify(res.body, null, 2)); }
262
258
  res.should.have.status(200);
263
259
  res.body.should.be.an('array').that.is.not.empty;
264
260
 
@@ -558,18 +554,18 @@ describe('FaqKBRoute', () => {
558
554
  })
559
555
 
560
556
 
561
- it('import json (overwrite true)', (done) => {
557
+ it('import json in an existing bot and replace all intents', (done) => {
562
558
 
563
559
  var email = "test-signup-" + Date.now() + "@email.com";
564
560
  var pwd = "pwd";
565
561
 
566
- userService.signup(email, pwd, "Test Firstname", "Test lastname").then(function (savedUser) {
567
- projectService.create("test-faqkb-create", savedUser._id).then(function (savedProject) {
562
+ userService.signup(email, pwd, "Test Firstname", "Test Lastname").then(((savedUser) => {
563
+ projectService.create('test-faqkb-create', savedUser._id).then((savedProject) => {
568
564
 
569
565
  chai.request(server)
570
- .post('/' + savedProject._id + '/faq_kb')
566
+ .post('/' + savedProject._id + '/faq_kb?replace=true')
571
567
  .auth(email, pwd)
572
- .send({ "name": "testbot", type: "internal", language: 'fr', template: "blank" })
568
+ .send({ "name": "testbot", type: "tilebot", language: "en", template: "blank " })
573
569
  .end((err, res) => {
574
570
  if (log) {
575
571
  console.log("res.body: ", res.body);
@@ -577,44 +573,46 @@ describe('FaqKBRoute', () => {
577
573
  res.should.have.status(200);
578
574
  res.body.should.be.a('object');
579
575
  expect(res.body.name).to.equal("testbot");
580
- expect(res.body.language).to.equal("fr");
576
+ expect(res.body.language).to.equal("en");
581
577
  let id_faq_kb = res.body._id;
582
578
 
583
579
  chai.request(server)
584
- .post('/' + savedProject._id + '/faq_kb/importjson/' + id_faq_kb + "?overwrite=true")
580
+ .get('/' + savedProject._id + '/faq/?id_faq_kb=' + id_faq_kb)
585
581
  .auth(email, pwd)
586
- .set('Content-Type', 'text/plain')
587
- .attach('uploadFile', fs.readFileSync(path.resolve(__dirname, './example.json')), 'example.json')
588
582
  .end((err, res) => {
589
- if (log) {
590
- console.log("import json res: ", res.body);
591
- }
592
- res.should.have.status(200);
593
- res.should.be.a('object');
594
- expect(res.body.name).to.equal("examplebot");
595
- expect(res.body.language).to.equal("en");
583
+
584
+ if (err) { console.error("err: ", err )};
585
+ if (log) { console.log("res.body: ", res.doby )};
586
+
587
+ res.should.have.status(200)
588
+ res.body.should.be.a('array');
589
+ expect(res.body.length).to.equal(0);
596
590
 
597
591
  chai.request(server)
598
- .get('/' + savedProject._id + '/faq?id_faq_kb=' + id_faq_kb)
592
+ .post('/' + savedProject._id + '/faq_kb/importjson/' + id_faq_kb)
599
593
  .auth(email, pwd)
594
+ .set('Content-Type', 'text/plain')
595
+ .attach('uploadFile', fs.readFileSync(path.resolve(__dirname, './example-json-rules.txt')), 'example-json-rules')
600
596
  .end((err, res) => {
601
597
  if (log) {
602
- console.log("faq_list: ", res.body);
598
+ console.log("import json res: ", JSON.stringify(res.body, null, 2));
603
599
  }
604
600
  res.should.have.status(200);
605
- res.body.should.be.an('array').that.is.not.empty;
606
-
601
+ //res.should.be.a('object');
602
+ //expect(res.body.name).to.equal("examplebot");
603
+ //expect(res.body.language).to.equal("en");
604
+
607
605
  done();
608
-
609
606
  })
610
607
  })
608
+
611
609
  })
612
610
  })
613
- })
611
+ }))
614
612
  })
615
613
 
616
-
617
- it('import json (overwrite false)', (done) => {
614
+ // DEPRECATED
615
+ it('import-json-overwrite-true', (done) => {
618
616
 
619
617
  var email = "test-signup-" + Date.now() + "@email.com";
620
618
  var pwd = "pwd";
@@ -622,6 +620,7 @@ describe('FaqKBRoute', () => {
622
620
  userService.signup(email, pwd, "Test Firstname", "Test lastname").then(function (savedUser) {
623
621
  projectService.create("test-faqkb-create", savedUser._id).then(function (savedProject) {
624
622
 
623
+
625
624
  chai.request(server)
626
625
  .post('/' + savedProject._id + '/faq_kb')
627
626
  .auth(email, pwd)
@@ -637,10 +636,10 @@ describe('FaqKBRoute', () => {
637
636
  let id_faq_kb = res.body._id;
638
637
 
639
638
  chai.request(server)
640
- .post('/' + savedProject._id + '/faq_kb/importjson/' + id_faq_kb)
639
+ .post('/' + savedProject._id + '/faq_kb/importjson/' + id_faq_kb + "?overwrite=true")
641
640
  .auth(email, pwd)
642
641
  .set('Content-Type', 'text/plain')
643
- .attach('uploadFile', fs.readFileSync(path.resolve(__dirname, './example-json.txt')), 'example-json.txt')
642
+ .attach('uploadFile', fs.readFileSync(path.resolve(__dirname, './example.json')), 'example.json')
644
643
  .end((err, res) => {
645
644
  if (log) {
646
645
  console.log("import json res: ", res.body);
@@ -669,7 +668,8 @@ describe('FaqKBRoute', () => {
669
668
  })
670
669
  })
671
670
 
672
- it('import json (simple)', (done) => {
671
+
672
+ it('import json', (done) => {
673
673
 
674
674
  var email = "test-signup-" + Date.now() + "@email.com";
675
675
  var pwd = "pwd";
@@ -680,7 +680,7 @@ describe('FaqKBRoute', () => {
680
680
  chai.request(server)
681
681
  .post('/' + savedProject._id + '/faq_kb')
682
682
  .auth(email, pwd)
683
- .send({ "name": "testbot", type: "internal", language: 'fr' })
683
+ .send({ "name": "testbot", type: "internal", language: 'fr', template: "blank" })
684
684
  .end((err, res) => {
685
685
  if (log) {
686
686
  console.log("res.body: ", res.body);
@@ -692,17 +692,18 @@ describe('FaqKBRoute', () => {
692
692
  let id_faq_kb = res.body._id;
693
693
 
694
694
  chai.request(server)
695
- .post('/' + savedProject._id + '/faq_kb/importjson/' + id_faq_kb + '?intentsOnly=true&overwrite=true')
695
+ .post('/' + savedProject._id + '/faq_kb/importjson/' + id_faq_kb)
696
696
  .auth(email, pwd)
697
697
  .set('Content-Type', 'text/plain')
698
- .attach('uploadFile', fs.readFileSync(path.resolve(__dirname, './example-json-intents.txt')), 'example-json-intents.txt')
698
+ .attach('uploadFile', fs.readFileSync(path.resolve(__dirname, './example-json.txt')), 'example-json.txt')
699
699
  .end((err, res) => {
700
700
  if (log) {
701
- console.log("import (intents only) json res: ", res.body);
701
+ console.log("import json res: ", res.body);
702
702
  }
703
703
  res.should.have.status(200);
704
- //res.should.be.a('object');
705
- //expect(res.body.success).to.equal(true);
704
+ res.should.be.a('object');
705
+ expect(res.body.name).to.equal("examplebot");
706
+ expect(res.body.language).to.equal("en");
706
707
 
707
708
  chai.request(server)
708
709
  .get('/' + savedProject._id + '/faq?id_faq_kb=' + id_faq_kb)
@@ -723,115 +724,172 @@ describe('FaqKBRoute', () => {
723
724
  })
724
725
  })
725
726
 
727
+ // DEPRECATED
728
+ // it('import json (simple)', (done) => {
726
729
 
727
- it('import json (intents only) (overwrite true)', (done) => {
730
+ // var email = "test-signup-" + Date.now() + "@email.com";
731
+ // var pwd = "pwd";
728
732
 
729
- var email = "test-signup-" + Date.now() + "@email.com";
730
- var pwd = "pwd";
733
+ // userService.signup(email, pwd, "Test Firstname", "Test lastname").then(function (savedUser) {
734
+ // projectService.create("test-faqkb-create", savedUser._id).then(function (savedProject) {
731
735
 
732
- userService.signup(email, pwd, "Test Firstname", "Test lastname").then(function (savedUser) {
733
- projectService.create("test-faqkb-create", savedUser._id).then(function (savedProject) {
736
+ // chai.request(server)
737
+ // .post('/' + savedProject._id + '/faq_kb')
738
+ // .auth(email, pwd)
739
+ // .send({ "name": "testbot", type: "internal", language: 'fr' })
740
+ // .end((err, res) => {
741
+ // if (log) {
742
+ // console.log("res.body: ", res.body);
743
+ // }
744
+ // res.should.have.status(200);
745
+ // res.body.should.be.a('object');
746
+ // expect(res.body.name).to.equal("testbot");
747
+ // expect(res.body.language).to.equal("fr");
748
+ // let id_faq_kb = res.body._id;
734
749
 
735
- chai.request(server)
736
- .post('/' + savedProject._id + '/faq_kb')
737
- .auth(email, pwd)
738
- .send({ "name": "testbot", type: "internal", language: 'fr', template: 'blank' })
739
- .end((err, res) => {
740
- if (log) {
741
- console.log("res.body: ", res.body);
742
- }
743
- res.should.have.status(200);
744
- res.body.should.be.a('object');
745
- expect(res.body.name).to.equal("testbot");
746
- expect(res.body.language).to.equal("fr");
747
- let id_faq_kb = res.body._id;
750
+ // chai.request(server)
751
+ // .post('/' + savedProject._id + '/faq_kb/importjson/' + id_faq_kb + '?intentsOnly=true&overwrite=true')
752
+ // .auth(email, pwd)
753
+ // .set('Content-Type', 'text/plain')
754
+ // .attach('uploadFile', fs.readFileSync(path.resolve(__dirname, './example-json-intents.txt')), 'example-json-intents.txt')
755
+ // .end((err, res) => {
756
+ // if (log) {
757
+ // console.log("import (intents only) json res: ", res.body);
758
+ // }
759
+ // res.should.have.status(200);
760
+ // //res.should.be.a('object');
761
+ // //expect(res.body.success).to.equal(true);
748
762
 
749
- chai.request(server)
750
- .post('/' + savedProject._id + '/faq_kb/importjson/' + id_faq_kb + '?intentsOnly=true&overwrite=true')
751
- .auth(email, pwd)
752
- .set('Content-Type', 'text/plain')
753
- .attach('uploadFile', fs.readFileSync(path.resolve(__dirname, './example-json-intents.txt')), 'example-json-intents.txt')
754
- .end((err, res) => {
755
- if (log) {
756
- console.log("import (intents only) json res: ", res.body);
757
- }
758
- res.should.have.status(200);
759
- //res.should.be.a('object');
760
- //expect(res.body.success).to.equal(true);
763
+ // chai.request(server)
764
+ // .get('/' + savedProject._id + '/faq?id_faq_kb=' + id_faq_kb)
765
+ // .auth(email, pwd)
766
+ // .end((err, res) => {
767
+ // if (log) {
768
+ // console.log("faq_list: ", res.body);
769
+ // }
770
+ // res.should.have.status(200);
771
+ // res.body.should.be.an('array').that.is.not.empty;
761
772
 
762
- chai.request(server)
763
- .get('/' + savedProject._id + '/faq?id_faq_kb=' + id_faq_kb)
764
- .auth(email, pwd)
765
- .end((err, res) => {
766
- if (log) {
767
- console.log("faq_list: ", res.body);
768
- }
769
- res.should.have.status(200);
770
- res.body.should.be.an('array').that.is.not.empty;
773
+ // done();
771
774
 
772
- done();
775
+ // })
776
+ // })
777
+ // })
778
+ // })
779
+ // })
780
+ // })
773
781
 
774
- })
775
- })
776
- })
777
- })
778
- })
779
- })
780
782
 
783
+ // DEPRECATED
784
+ // it('import json (intents only) (overwrite true)', (done) => {
781
785
 
782
- it('import json (intents only) (overwrite false)', (done) => {
786
+ // var email = "test-signup-" + Date.now() + "@email.com";
787
+ // var pwd = "pwd";
783
788
 
784
- var email = "test-signup-" + Date.now() + "@email.com";
785
- var pwd = "pwd";
789
+ // userService.signup(email, pwd, "Test Firstname", "Test lastname").then(function (savedUser) {
790
+ // projectService.create("test-faqkb-create", savedUser._id).then(function (savedProject) {
786
791
 
787
- userService.signup(email, pwd, "Test Firstname", "Test lastname").then(function (savedUser) {
788
- projectService.create("test-faqkb-create", savedUser._id).then(function (savedProject) {
792
+ // chai.request(server)
793
+ // .post('/' + savedProject._id + '/faq_kb')
794
+ // .auth(email, pwd)
795
+ // .send({ "name": "testbot", type: "internal", language: 'fr', template: 'blank' })
796
+ // .end((err, res) => {
797
+ // if (log) {
798
+ // console.log("res.body: ", res.body);
799
+ // }
800
+ // res.should.have.status(200);
801
+ // res.body.should.be.a('object');
802
+ // expect(res.body.name).to.equal("testbot");
803
+ // expect(res.body.language).to.equal("fr");
804
+ // let id_faq_kb = res.body._id;
789
805
 
790
- chai.request(server)
791
- .post('/' + savedProject._id + '/faq_kb')
792
- .auth(email, pwd)
793
- .send({ "name": "testbot", type: "internal", language: 'fr', template: 'blank' })
794
- .end((err, res) => {
795
- if (log) {
796
- console.log("res.body: ", res.body);
797
- }
798
- res.should.have.status(200);
799
- res.body.should.be.a('object');
800
- expect(res.body.name).to.equal("testbot");
801
- expect(res.body.language).to.equal("fr");
802
- let id_faq_kb = res.body._id;
806
+ // chai.request(server)
807
+ // .post('/' + savedProject._id + '/faq_kb/importjson/' + id_faq_kb + '?intentsOnly=true&overwrite=true')
808
+ // .auth(email, pwd)
809
+ // .set('Content-Type', 'text/plain')
810
+ // .attach('uploadFile', fs.readFileSync(path.resolve(__dirname, './example-json-intents.txt')), 'example-json-intents.txt')
811
+ // .end((err, res) => {
812
+ // if (log) {
813
+ // console.log("import (intents only) json res: ", res.body);
814
+ // }
815
+ // res.should.have.status(200);
816
+ // //res.should.be.a('object');
817
+ // //expect(res.body.success).to.equal(true);
803
818
 
804
- chai.request(server)
805
- .post('/' + savedProject._id + '/faq_kb/importjson/' + id_faq_kb + '?intentsOnly=true')
806
- .auth(email, pwd)
807
- .set('Content-Type', 'text/plain')
808
- .attach('uploadFile', fs.readFileSync(path.resolve(__dirname, './example-json-intents.txt')), 'example-json-intents.txt')
809
- .end((err, res) => {
810
- if (log) {
811
- console.log("import (intents only) json res: ", res.body);
812
- }
813
- res.should.have.status(200);
814
- //res.should.be.a('object');
815
- //expect(res.body.success).to.equal(true);
819
+ // chai.request(server)
820
+ // .get('/' + savedProject._id + '/faq?id_faq_kb=' + id_faq_kb)
821
+ // .auth(email, pwd)
822
+ // .end((err, res) => {
823
+ // if (log) {
824
+ // console.log("faq_list: ", res.body);
825
+ // }
826
+ // res.should.have.status(200);
827
+ // res.body.should.be.an('array').that.is.not.empty;
816
828
 
817
- chai.request(server)
818
- .get('/' + savedProject._id + '/faq?id_faq_kb=' + id_faq_kb)
819
- .auth(email, pwd)
820
- .end((err, res) => {
821
- if (log) {
822
- console.log("faq_list: ", res.body);
823
- }
824
- res.should.have.status(200);
825
- res.body.should.be.an('array').that.is.not.empty;
829
+ // done();
826
830
 
827
- done();
831
+ // })
832
+ // })
833
+ // })
834
+ // })
835
+ // })
836
+ // })
828
837
 
829
- })
830
- })
831
- })
832
- })
833
- })
834
- })
838
+
839
+ // DEPRECATED
840
+ // it('import json (intents only) (overwrite false)', (done) => {
841
+
842
+ // var email = "test-signup-" + Date.now() + "@email.com";
843
+ // var pwd = "pwd";
844
+
845
+ // userService.signup(email, pwd, "Test Firstname", "Test lastname").then(function (savedUser) {
846
+ // projectService.create("test-faqkb-create", savedUser._id).then(function (savedProject) {
847
+
848
+ // chai.request(server)
849
+ // .post('/' + savedProject._id + '/faq_kb')
850
+ // .auth(email, pwd)
851
+ // .send({ "name": "testbot", type: "internal", language: 'fr', template: 'blank' })
852
+ // .end((err, res) => {
853
+ // if (log) {
854
+ // console.log("res.body: ", res.body);
855
+ // }
856
+ // res.should.have.status(200);
857
+ // res.body.should.be.a('object');
858
+ // expect(res.body.name).to.equal("testbot");
859
+ // expect(res.body.language).to.equal("fr");
860
+ // let id_faq_kb = res.body._id;
861
+
862
+ // chai.request(server)
863
+ // .post('/' + savedProject._id + '/faq_kb/importjson/' + id_faq_kb + '?intentsOnly=true')
864
+ // .auth(email, pwd)
865
+ // .set('Content-Type', 'text/plain')
866
+ // .attach('uploadFile', fs.readFileSync(path.resolve(__dirname, './example-json-intents.txt')), 'example-json-intents.txt')
867
+ // .end((err, res) => {
868
+ // if (log) {
869
+ // console.log("import (intents only) json res: ", res.body);
870
+ // }
871
+ // res.should.have.status(200);
872
+ // //res.should.be.a('object');
873
+ // //expect(res.body.success).to.equal(true);
874
+
875
+ // chai.request(server)
876
+ // .get('/' + savedProject._id + '/faq?id_faq_kb=' + id_faq_kb)
877
+ // .auth(email, pwd)
878
+ // .end((err, res) => {
879
+ // if (log) {
880
+ // console.log("faq_list: ", res.body);
881
+ // }
882
+ // res.should.have.status(200);
883
+ // res.body.should.be.an('array').that.is.not.empty;
884
+
885
+ // done();
886
+
887
+ // })
888
+ // })
889
+ // })
890
+ // })
891
+ // })
892
+ // })
835
893
 
836
894
 
837
895
  it('exportjson', (done) => {
@@ -879,7 +937,6 @@ describe('FaqKBRoute', () => {
879
937
  if (log) {
880
938
  console.log("export json res: ", res.body);
881
939
  }
882
- console.log("export json res: ", res.body);
883
940
  res.should.have.status(200);
884
941
  //res.body.should.be.a('string');
885
942
 
@@ -205,48 +205,51 @@ describe('ProjectRoute', () => {
205
205
  it('departmentGroupAvailableUsers', (done) => {
206
206
 
207
207
  var email = "test-signup-" + Date.now() + "@email.com";
208
- var email2 = "test-signup2-" + Date.now() + "@email.com";
209
208
  var pwd = "pwd";
210
209
 
211
210
  userService.signup(email, pwd, "Test Firstname", "Test Lastname").then((savedUser) => {
212
- // ignore second user (need to be added to the same project)
213
- userService.signup(email2, pwd, "Test Firstname 2", "Test Lastname 2").then((savedUser2) => {
214
- projectService.create("test-project-create", savedUser._id).then((savedProject) => {
215
-
216
- chai.request(server)
217
- .post('/' + savedProject._id + '/groups')
218
- .auth(email, pwd)
219
- .send({ name: "test-department-group", members: [savedUser._id] })
220
- .end((err, res) => {
221
-
222
- if (err) { console.error("err: ", err) };
223
- if (log) { console.log("create group res.body: ", res.body); }
224
- let savedGroup = res.body;
225
-
226
- chai.request(server)
227
- .post('/' + savedProject._id + '/departments/')
228
- .auth(email, pwd)
229
- .send({ id_project: "66977908249376002d57a434", name: "test-department", routing: "assigned", id_group: savedGroup._id })
230
- .end((err, res) => {
231
-
232
- if (err) { console.error("err: ", err) };
233
- if (log) { console.log("savedDepartment: ", res.body); }
234
- let savedDepartment = res.body;
235
-
236
- chai.request(server)
237
- .get('/projects/' + savedProject._id + '/users/availables/?department=' + savedDepartment._id)
238
- .auth(email, pwd)
239
- .end((err, res) => {
240
-
241
- if (err) { console.error("err: ", err); }
242
- if (log) { console.log("res.body: ", res.body); }
243
-
244
- done();
245
- })
246
-
247
- })
248
- })
249
- })
211
+ projectService.create("test-project-create", savedUser._id).then((savedProject) => {
212
+
213
+ chai.request(server)
214
+ .post('/' + savedProject._id + '/groups')
215
+ .auth(email, pwd)
216
+ .send({ name: "test-department-group", members: [savedUser._id] })
217
+ .end((err, res) => {
218
+
219
+ if (err) { console.error("err: ", err) };
220
+ if (log) { console.log("create group res.body: ", res.body); }
221
+ let savedGroup = res.body;
222
+
223
+ chai.request(server)
224
+ .post('/' + savedProject._id + '/departments/')
225
+ .auth(email, pwd)
226
+ .send({ id_project: "66977908249376002d57a434", name: "test-department", routing: "assigned", id_group: savedGroup._id })
227
+ .end((err, res) => {
228
+
229
+ if (err) { console.error("err: ", err) };
230
+ if (log) { console.log("savedDepartment: ", res.body); }
231
+ let savedDepartment = res.body;
232
+
233
+ chai.request(server)
234
+ .get('/projects/' + savedProject._id + '/users/availables/?department=' + savedDepartment._id)
235
+ .auth(email, pwd)
236
+ .end((err, res) => {
237
+
238
+ if (err) { console.error("err: ", err); }
239
+ if (log) { console.log("res.body: ", res.body); }
240
+
241
+ res.should.have.status(200);
242
+ res.body.should.be.a('array');
243
+ expect(res.body.length).to.equal(1);
244
+ expect(res.body[0].id).to.equal(savedUser._id.toString());
245
+ expect(res.body[0].fullname).to.equal(savedUser.firstname + " " + savedUser.lastname);
246
+ expect(res.body[0].assigned_request).to.equal(0);
247
+
248
+ done();
249
+ })
250
+
251
+ })
252
+ })
250
253
  })
251
254
  })
252
255
  }).timeout(10000)