Skip to content
This repository was archived by the owner on Oct 10, 2022. It is now read-only.

Commit 76eeef0

Browse files
committed
Fix netlift typo
1 parent b2af152 commit 76eeef0

File tree

1 file changed

+73
-73
lines changed

1 file changed

+73
-73
lines changed

spec/bitballoon.spec.js

Lines changed: 73 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
if (typeof(require) !== 'undefined') {
2-
var bitballoon = require("../lib/bitballoon.js"),
2+
var netlify = require("../lib/netlify.js"),
33
crypto = require("crypto"),
44
fs = require("fs");
55
}
@@ -25,7 +25,7 @@ var http = {
2525
request = new Emitter(),
2626
response = new Emitter(),
2727
requestBody = "";
28-
28+
2929
request.write = function(data) { requestBody += data; };
3030
request.end = function() {
3131
options.body = requestBody;
@@ -38,9 +38,9 @@ var http = {
3838
cb(response);
3939
response.emit('data', test.response);
4040
response.emit('end');
41-
}, 0);
41+
}, 0);
4242
}
43-
43+
4444
return request;
4545
}
4646
};
@@ -49,7 +49,7 @@ var firstIfArray = function(obj) {
4949
return Array.isArray(obj) ? obj.shift() : obj;
5050
};
5151

52-
describe("bitballoon", function() {
52+
describe("netlify", function() {
5353
var testApiCall = function(options) {
5454
var httpCalls = Array.isArray(options.http) ? options.http : [options.http];
5555
httpCalls.forEach(function(httpCall) {
@@ -64,21 +64,21 @@ describe("bitballoon", function() {
6464
waitsFor(options.waitsFor, 100);
6565
runs(options.expectations);
6666
};
67-
67+
6868
beforeEach(function() {
6969
http.test = [];
7070
});
7171

7272
it("should create a client", function() {
73-
var client = bitballoon.createClient({access_token: "1234"});
73+
var client = netlify.createClient({access_token: "1234"});
7474
expect(client.access_token).toEqual("1234");
7575
expect(client.isAuthorized()).toEqual(true);
7676
});
7777

7878
it("should authenticate from credentials", function() {
79-
var client = bitballoon.createClient({client_id: "client_id", client_secret: "client_secret", http: http});
80-
var access_token = null;
81-
79+
var client = netlify.createClient({client_id: "client_id", client_secret: "client_secret", http: http});
80+
var access_token = null;
81+
8282
testApiCall({
8383
http: {
8484
expectations: function(options) {
@@ -102,25 +102,25 @@ describe("bitballoon", function() {
102102
});
103103

104104
it("should generate an authorize url", function() {
105-
var client = bitballoon.createClient({
106-
client_id: "client_id",
105+
var client = netlify.createClient({
106+
client_id: "client_id",
107107
client_secret: "client_secret",
108108
redirect_uri: "http://www.example.com/callback"
109109
});
110110
var url = client.authorizeUrl();
111111

112-
expect(url).toEqual("https://www.bitballoon.com/oauth/authorize?response_type=code&client_id=client_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fcallback")
112+
expect(url).toEqual("https://www.netlify.com/oauth/authorize?response_type=code&client_id=client_id&redirect_uri=http%3A%2F%2Fwww.example.com%2Fcallback")
113113
});
114114

115115
it("should authorize from authorization code", function() {
116-
var client = bitballoon.createClient({
117-
client_id: "client_id",
116+
var client = netlify.createClient({
117+
client_id: "client_id",
118118
client_secret: "client_secret",
119119
redirect_uri: "http://www.example.com/callback",
120120
http: http
121121
});
122122
var access_token = null;
123-
123+
124124
testApiCall({
125125
http: {
126126
expectations: function(options) {
@@ -144,9 +144,9 @@ describe("bitballoon", function() {
144144
});
145145

146146
it("should get a list of sites", function() {
147-
var client = bitballoon.createClient({access_token: "1234", http: http}),
147+
var client = netlify.createClient({access_token: "1234", http: http}),
148148
sites = [];
149-
149+
150150
testApiCall({
151151
http: {
152152
expectations: function(options) {
@@ -165,9 +165,9 @@ describe("bitballoon", function() {
165165
});
166166

167167
it("should get a list of sites with pagination", function() {
168-
var client = bitballoon.createClient({access_token: "1234", http: http}),
168+
var client = netlify.createClient({access_token: "1234", http: http}),
169169
sites = [];
170-
170+
171171
testApiCall({
172172
http: {
173173
expectations: function(options) {
@@ -186,15 +186,15 @@ describe("bitballoon", function() {
186186
});
187187

188188
it("should get a single site", function() {
189-
var client = bitballoon.createClient({access_token: "1234", http: http}),
189+
var client = netlify.createClient({access_token: "1234", http: http}),
190190
site = null;
191191

192192
testApiCall({
193193
http: {
194194
expectations: function(options) {
195195
expect(options.headers['Authorization']).toEqual("Bearer 1234");
196196
expect(options.method).toEqual("get");
197-
expect(options.path).toEqual("/api/v1/sites/123");
197+
expect(options.path).toEqual("/api/v1/sites/123");
198198
},
199199
response: {id: "123"}
200200
},
@@ -205,17 +205,17 @@ describe("bitballoon", function() {
205205
}
206206
});
207207
});
208-
208+
209209
it("should refresh the state of a site", function() {
210-
var client = bitballoon.createClient({access_token: "1234", http: http}),
211-
site = new bitballoon.Client.models.Site(client, {id: "123", state: "processing"});
212-
210+
var client = netlify.createClient({access_token: "1234", http: http}),
211+
site = new netlify.Client.models.Site(client, {id: "123", state: "processing"});
212+
213213
testApiCall({
214214
http: {
215215
expectations: function(options) {
216216
expect(options.headers['Authorization']).toEqual("Bearer 1234");
217217
expect(options.method).toEqual("get");
218-
expect(options.path).toEqual("/api/v1/sites/123");
218+
expect(options.path).toEqual("/api/v1/sites/123");
219219
},
220220
response: {id: 123, state: "current"}
221221
},
@@ -226,10 +226,10 @@ describe("bitballoon", function() {
226226
}
227227
});
228228
});
229-
229+
230230
it("should update a site", function() {
231-
var client = bitballoon.createClient({access_token: "1234", http: http}),
232-
site = new bitballoon.Client.models.Site(client, {id: "123", name: "test"});
231+
var client = netlify.createClient({access_token: "1234", http: http}),
232+
site = new netlify.Client.models.Site(client, {id: "123", name: "test"});
233233

234234
testApiCall({
235235
http: {
@@ -249,10 +249,10 @@ describe("bitballoon", function() {
249249
}
250250
});
251251
});
252-
252+
253253
it("should destroy a site", function() {
254-
var client = bitballoon.createClient({access_token: "1234", http: http}),
255-
site = new bitballoon.Client.models.Site(client, {id: "123", name: "test"}),
254+
var client = netlify.createClient({access_token: "1234", http: http}),
255+
site = new netlify.Client.models.Site(client, {id: "123", name: "test"}),
256256
done = false;
257257

258258
testApiCall({
@@ -274,11 +274,11 @@ describe("bitballoon", function() {
274274
}
275275
});
276276
});
277-
277+
278278
it("should list all forms", function() {
279-
var client = bitballoon.createClient({access_token: "1234", http: http}),
279+
var client = netlify.createClient({access_token: "1234", http: http}),
280280
forms = null;
281-
281+
282282
testApiCall({
283283
http: {
284284
expectations: function(options) {
@@ -294,12 +294,12 @@ describe("bitballoon", function() {
294294
}
295295
});
296296
});
297-
297+
298298
it("should list forms for a site", function() {
299-
var client = bitballoon.createClient({access_token: "1234", http: http}),
300-
site = new bitballoon.Client.models.Site(client, {id: "123", name: "test"}),
299+
var client = netlify.createClient({access_token: "1234", http: http}),
300+
site = new netlify.Client.models.Site(client, {id: "123", name: "test"}),
301301
forms = null;
302-
302+
303303
testApiCall({
304304
http: {
305305
expectations: function(options) {
@@ -315,11 +315,11 @@ describe("bitballoon", function() {
315315
}
316316
});
317317
})
318-
318+
319319
it("should create a user", function() {
320-
var client = bitballoon.createClient({access_token: "1234", http: http}),
320+
var client = netlify.createClient({access_token: "1234", http: http}),
321321
user = null;
322-
322+
323323
testApiCall({
324324
http: {
325325
expectations: function(options) {
@@ -339,10 +339,10 @@ describe("bitballoon", function() {
339339
}
340340
})
341341
});
342-
342+
343343
it("should update a user", function() {
344-
var client = bitballoon.createClient({access_token: "1234", http: http}),
345-
user = new bitballoon.Client.models.User(client, {id: "123", email: "test@example.com"}),
344+
var client = netlify.createClient({access_token: "1234", http: http}),
345+
user = new netlify.Client.models.User(client, {id: "123", email: "test@example.com"}),
346346
done = false;
347347

348348
testApiCall({
@@ -364,10 +364,10 @@ describe("bitballoon", function() {
364364
}
365365
});
366366
});
367-
367+
368368
it("should destroy a user", function() {
369-
var client = bitballoon.createClient({access_token: "1234", http: http}),
370-
user = new bitballoon.Client.models.User(client, {id: "123", email: "test@example.com"}),
369+
var client = netlify.createClient({access_token: "1234", http: http}),
370+
user = new netlify.Client.models.User(client, {id: "123", email: "test@example.com"}),
371371
done = false;
372372

373373
testApiCall({
@@ -389,12 +389,12 @@ describe("bitballoon", function() {
389389
}
390390
});
391391
});
392-
392+
393393
it("should create a snippet", function() {
394-
var client = bitballoon.createClient({access_token: "1234", http: http}),
395-
site = new bitballoon.Client.models.Site(client, {id: "123", name: "test"}),
394+
var client = netlify.createClient({access_token: "1234", http: http}),
395+
site = new netlify.Client.models.Site(client, {id: "123", name: "test"}),
396396
snippet = null;
397-
397+
398398
testApiCall({
399399
http: {
400400
expectations: function(options) {
@@ -417,10 +417,10 @@ describe("bitballoon", function() {
417417
}
418418
});
419419
});
420-
420+
421421
it("should update a snippet", function() {
422-
var client = bitballoon.createClient({access_token: "1234", http: http}),
423-
snippet = new bitballoon.Client.models.Snippet(client, {id: "1", title: "test", site_id: "123"}),
422+
var client = netlify.createClient({access_token: "1234", http: http}),
423+
snippet = new netlify.Client.models.Snippet(client, {id: "1", title: "test", site_id: "123"}),
424424
done = false;
425425

426426
testApiCall({
@@ -444,10 +444,10 @@ describe("bitballoon", function() {
444444
}
445445
})
446446
});
447-
447+
448448
it("should delete a snippet", function() {
449-
var client = bitballoon.createClient({access_token: "1234", http: http}),
450-
snippet = new bitballoon.Client.models.Snippet(client, {id: "1", title: "test", site_id: "123"}),
449+
var client = netlify.createClient({access_token: "1234", http: http}),
450+
snippet = new netlify.Client.models.Snippet(client, {id: "1", title: "test", site_id: "123"}),
451451
done = false;
452452

453453
testApiCall({
@@ -468,11 +468,11 @@ describe("bitballoon", function() {
468468
expect(done).toEqual(true);
469469
}
470470
})
471-
});
472-
471+
});
472+
473473
it("should restore an old deploy", function() {
474-
var client = bitballoon.createClient({access_token: "1234", http: http}),
475-
deploy = new bitballoon.Client.models.Deploy(client, {id: "1", state: "old", site_id: "123"}),
474+
var client = netlify.createClient({access_token: "1234", http: http}),
475+
deploy = new netlify.Client.models.Deploy(client, {id: "1", state: "old", site_id: "123"}),
476476
done = false;
477477

478478
testApiCall({
@@ -494,17 +494,17 @@ describe("bitballoon", function() {
494494
}
495495
});
496496
});
497-
497+
498498
// Node specific methods
499499
if (typeof(window) === "undefined") {
500500
var crypto = require('crypto'),
501501
fs = require('fs');
502-
502+
503503
it("should upload a site from a dir", function() {
504-
var client = bitballoon.createClient({access_token: "1234", http: http}),
504+
var client = netlify.createClient({access_token: "1234", http: http}),
505505
site = null,
506506
shasum = crypto.createHash('sha1');
507-
507+
508508
shasum.update(fs.readFileSync(__dirname + '/files/site-dir/index.html'));
509509

510510
var index_sha = shasum.digest('hex');
@@ -515,7 +515,7 @@ describe("bitballoon", function() {
515515
expectations: function(options) {
516516
expect(options.headers['Authorization']).toEqual("Bearer 1234");
517517
expect(options.method).toEqual("post");
518-
expect(options.path).toEqual("/api/v1/sites");
518+
expect(options.path).toEqual("/api/v1/sites");
519519
},
520520
status: 201,
521521
response: {id: 123, state: "uploading", required: [index_sha]}
@@ -533,7 +533,7 @@ describe("bitballoon", function() {
533533
expectations: function(options) {
534534
expect(options.headers['Authorization']).toEqual("Bearer 1234");
535535
expect(options.method).toEqual("get");
536-
expect(options.path).toEqual("/api/v1/sites/123");
536+
expect(options.path).toEqual("/api/v1/sites/123");
537537
},
538538
response: {id: 123, state: "processing"}
539539
}
@@ -547,11 +547,11 @@ describe("bitballoon", function() {
547547
}
548548
});
549549
});
550-
550+
551551
it("should upload a site from a zip", function() {
552-
var client = bitballoon.createClient({access_token: "1234", http: http}),
552+
var client = netlify.createClient({access_token: "1234", http: http}),
553553
site = null;
554-
554+
555555
testApiCall({
556556
http: {
557557
expectations: function(options) {
@@ -572,4 +572,4 @@ describe("bitballoon", function() {
572572
})
573573
});
574574
}
575-
});
575+
});

0 commit comments

Comments
 (0)