Skip to content

Commit 2d8cc48

Browse files
author
Dan Tolbert
committed
update tests to hit /accounts/FakeAccountId/importtnorders
1 parent fa20ed4 commit 2d8cc48

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

test/importTnOrder.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ describe("ImportTnOrders", function(){
3636
};
3737
var numbers = ["9198675309", "8288675309"];
3838
data.telephoneNumbers = [numbers.map(number => {return {telephoneNumber: number}})];
39-
helper.nock().post("/accounts/FakeAccountId/importTnOrders", helper.buildXml({importTnOrder: data})).reply(200, helper.xml.importTnOrder);
39+
helper.nock().post("/accounts/FakeAccountId/importtnorders", helper.buildXml({importTnOrder: data})).reply(200, helper.xml.importTnOrder);
4040
ImportTnOrder.create(helper.createClient(), data, numbers, function(err, item){
4141
if(err){
4242
return done(err);
@@ -65,7 +65,7 @@ describe("ImportTnOrders", function(){
6565
};
6666
var numbers = ["9198675309", "8288675309"];
6767
data.telephoneNumbers = [numbers.map(number => {return {telephoneNumber: number}})];
68-
helper.nock().post("/accounts/FakeAccountId/importTnOrders", helper.buildXml({importTnOrder: data})).reply(200, helper.xml.importTnOrder);
68+
helper.nock().post("/accounts/FakeAccountId/importtnorders", helper.buildXml({importTnOrder: data})).reply(200, helper.xml.importTnOrder);
6969
ImportTnOrder.create(helper.createClient(), data, numbers, function(err, item){
7070
if(err){
7171
return done(err);
@@ -93,7 +93,7 @@ describe("ImportTnOrders", function(){
9393
}
9494
};
9595
var numbers = ["9198675309", "8288675309"];
96-
helper.nock().post("/accounts/FakeAccountId/importTnOrders").reply(400, "");
96+
helper.nock().post("/accounts/FakeAccountId/importtnorders").reply(400, "");
9797
ImportTnOrder.create(helper.createClient(), data, numbers, function(err, item){
9898
if(err){
9999
return done();
@@ -104,7 +104,7 @@ describe("ImportTnOrders", function(){
104104
});
105105
describe("#getImportTnOrder", function(){
106106
it("should return a importTnOrder", function(done){
107-
helper.nock().get("/accounts/FakeAccountId/importTnOrders/021a94f5-5c55-401f-9cdc-8dca059ad7c1").reply(200, helper.xml.importTnOrderResponse, {"Content-Type": "application/xml"});
107+
helper.nock().get("/accounts/FakeAccountId/importtnorders/021a94f5-5c55-401f-9cdc-8dca059ad7c1").reply(200, helper.xml.importTnOrderResponse, {"Content-Type": "application/xml"});
108108
ImportTnOrder.get("021a94f5-5c55-401f-9cdc-8dca059ad7c1", (err, item) => {
109109
if(err){
110110
return done(err);
@@ -117,7 +117,7 @@ describe("ImportTnOrders", function(){
117117
});
118118
describe("#getImportTnOrders", function(){
119119
it("should return a list of ImportTnOrderSummary(s)", function(done){
120-
helper.nock().get("/accounts/FakeAccountId/importTnOrders").reply(200, helper.xml.importTnOrderList, {"Content-Type": "application/xml"});
120+
helper.nock().get("/accounts/FakeAccountId/importtnorders").reply(200, helper.xml.importTnOrderList, {"Content-Type": "application/xml"});
121121
ImportTnOrder.list({}, (err, items) => {
122122
if(err){
123123
return done(err);
@@ -130,7 +130,7 @@ describe("ImportTnOrders", function(){
130130
});
131131
describe("#getHistory", function(){
132132
it("should return histoy", function(done){
133-
helper.nock().get("/accounts/FakeAccountId/importTnOrders/1/history").reply(200, helper.xml.importTnOrderHistory, {"Content-Type": "application/xml"});
133+
helper.nock().get("/accounts/FakeAccountId/importtnorders/1/history").reply(200, helper.xml.importTnOrderHistory, {"Content-Type": "application/xml"});
134134
var order = new ImportTnOrder();
135135
order.id = 1;
136136
order.client = helper.createClient();
@@ -145,7 +145,7 @@ describe("ImportTnOrders", function(){
145145
});
146146
describe("#getFiles", function(){
147147
it("should return list of files", function(done){
148-
helper.nock().get("/accounts/FakeAccountId/importTnOrders/1/loas?metadata=true").reply(200, helper.xml.files, {"Content-Type": "application/xml"});
148+
helper.nock().get("/accounts/FakeAccountId/importtnorders/1/loas?metadata=true").reply(200, helper.xml.files, {"Content-Type": "application/xml"});
149149
var order = new ImportTnOrder();
150150
order.id = 1;
151151
order.client = helper.createClient();
@@ -160,7 +160,7 @@ describe("ImportTnOrders", function(){
160160
});
161161
});
162162
it("should return list of files (without metadata)", function(done){
163-
helper.nock().get("/accounts/FakeAccountId/importTnOrders/1/loas?metadata=false").reply(200, helper.xml.files, {"Content-Type": "application/xml"});
163+
helper.nock().get("/accounts/FakeAccountId/importtnorders/1/loas?metadata=false").reply(200, helper.xml.files, {"Content-Type": "application/xml"});
164164
var order = new ImportTnOrder();
165165
order.id = 1;
166166
order.client = helper.createClient();
@@ -174,7 +174,7 @@ describe("ImportTnOrders", function(){
174174
});
175175
});
176176
it("should fail for error status code", function(done){
177-
helper.nock().get("/accounts/FakeAccountId/importTnOrders/1/loas?metadata=false").reply(400);
177+
helper.nock().get("/accounts/FakeAccountId/importtnorders/1/loas?metadata=false").reply(400);
178178
var order = new ImportTnOrder();
179179
order.id = 1;
180180
order.client = helper.createClient();
@@ -187,7 +187,7 @@ describe("ImportTnOrders", function(){
187187
});
188188
describe("#getFileMetadata", function(){
189189
it("should return file's metadata", function(done){
190-
helper.nock().get("/accounts/FakeAccountId/importTnOrders/1/loas/file.txt/metadata").reply(200, helper.xml.fileMetadata, {"Content-Type": "application/xml"});
190+
helper.nock().get("/accounts/FakeAccountId/importtnorders/1/loas/file.txt/metadata").reply(200, helper.xml.fileMetadata, {"Content-Type": "application/xml"});
191191
var order = new ImportTnOrder();
192192
order.id = 1;
193193
order.client = helper.createClient();
@@ -203,7 +203,7 @@ describe("ImportTnOrders", function(){
203203
describe("#updateFileMetadata", function(){
204204
it("should update file's metadata", function(done){
205205
var metadata = { documentName: "doc", documentType: "type"};
206-
helper.nock().put("/accounts/FakeAccountId/importTnOrders/1/loas/file.txt/metadata", helper.buildXml({ fileMetaData: metadata})).reply(200);
206+
helper.nock().put("/accounts/FakeAccountId/importtnorders/1/loas/file.txt/metadata", helper.buildXml({ fileMetaData: metadata})).reply(200);
207207
var order = new ImportTnOrder();
208208
order.id = 1;
209209
order.client = helper.createClient();
@@ -213,7 +213,7 @@ describe("ImportTnOrders", function(){
213213
describe("#getFile", function(){
214214
var tmpFile = path.join(os.tmpdir(), "dest.txt");
215215
beforeEach(function(){
216-
helper.nock().get("/accounts/FakeAccountId/importTnOrders/1/loas/file.txt").reply(200, "12345", {"Content-Type": "text/plain"});
216+
helper.nock().get("/accounts/FakeAccountId/importtnorders/1/loas/file.txt").reply(200, "12345", {"Content-Type": "text/plain"});
217217
});
218218
afterEach(function(done){
219219
nock.cleanAll();
@@ -268,7 +268,7 @@ describe("ImportTnOrders", function(){
268268
describe("#createFile", function(){
269269
var order, tmpFile = path.join(os.tmpdir(), "dest.txt");
270270
beforeEach(function(done){
271-
helper.nock().post("/accounts/FakeAccountId/importTnOrders/1/loas", "12345", {"Content-Type": "text/plain"}).reply(200, helper.xml.fileCreated, {"Content-Type": "application/xml"});
271+
helper.nock().post("/accounts/FakeAccountId/importtnorders/1/loas", "12345", {"Content-Type": "text/plain"}).reply(200, helper.xml.fileCreated, {"Content-Type": "application/xml"});
272272
order = new ImportTnOrder();
273273
order.id = 1;
274274
order.client = helper.createClient();
@@ -307,7 +307,7 @@ describe("ImportTnOrders", function(){
307307
});
308308
it("should fail on error status code", function(done){
309309
nock.cleanAll();
310-
helper.nock().post("/accounts/FakeAccountId/importTnOrders/1/loas", "11111", {"Content-Type": "text/plain"}).reply(400);
310+
helper.nock().post("/accounts/FakeAccountId/importtnorders/1/loas", "11111", {"Content-Type": "text/plain"}).reply(400);
311311
order.createFile(new Buffer.from("11111", "utf8"), "text/plain", function(err, fileName){
312312
if(err){
313313
return done();
@@ -317,7 +317,7 @@ describe("ImportTnOrders", function(){
317317
});
318318
it("should upload file to the server (default media type)", function(done){
319319
nock.cleanAll();
320-
helper.nock().post("/accounts/FakeAccountId/importTnOrders/1/loas", "12345", {"Content-Type": "application/octet-stream"}).reply(200, helper.xml.fileCreated, {"Content-Type": "application/xml"});
320+
helper.nock().post("/accounts/FakeAccountId/importtnorders/1/loas", "12345", {"Content-Type": "application/octet-stream"}).reply(200, helper.xml.fileCreated, {"Content-Type": "application/xml"});
321321
order.createFile(new Buffer.from("12345", "utf8"), function(err, fileName){
322322
if(err){
323323
return done(err);
@@ -330,7 +330,7 @@ describe("ImportTnOrders", function(){
330330
describe("#updateFile", function(){
331331
var order, tmpFile = path.join(os.tmpdir(), "dest.txt");
332332
beforeEach(function(done){
333-
helper.nock().put("/accounts/FakeAccountId/importTnOrders/1/loas/test.txt", "12345", {"Content-Type": "text/plain"}).reply(200);
333+
helper.nock().put("/accounts/FakeAccountId/importtnorders/1/loas/test.txt", "12345", {"Content-Type": "text/plain"}).reply(200);
334334
order = new ImportTnOrder();
335335
order.id = 1;
336336
order.client = helper.createClient();
@@ -351,7 +351,7 @@ describe("ImportTnOrders", function(){
351351
});
352352
it("should fail on error status code", function(done){
353353
nock.cleanAll();
354-
helper.nock().put("/accounts/FakeAccountId/importTnOrders/1/loas/test.txt", "11111", {"Content-Type": "text/plain"}).reply(400);
354+
helper.nock().put("/accounts/FakeAccountId/importtnorders/1/loas/test.txt", "11111", {"Content-Type": "text/plain"}).reply(400);
355355
order.updateFile("test.txt", new Buffer.from("11111", "utf8"), "text/plain", function(err){
356356
if(err){
357357
return done();
@@ -361,7 +361,7 @@ describe("ImportTnOrders", function(){
361361
});
362362
it("should upload file to the server (default media type)", function(done){
363363
nock.cleanAll();
364-
helper.nock().put("/accounts/FakeAccountId/importTnOrders/1/loas/test.txt", "12345", {"Content-Type": "application/octet-stream"}).reply(200, helper.xml.fileCreated, {"Content-Type": "application/xml"});
364+
helper.nock().put("/accounts/FakeAccountId/importtnorders/1/loas/test.txt", "12345", {"Content-Type": "application/octet-stream"}).reply(200, helper.xml.fileCreated, {"Content-Type": "application/xml"});
365365
order.updateFile("test.txt", new Buffer.from("12345", "utf8"), done);
366366
});
367367
});

0 commit comments

Comments
 (0)