forked from tidev/node-appc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-auth.js
More file actions
53 lines (46 loc) · 1.23 KB
/
test-auth.js
File metadata and controls
53 lines (46 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/**
* node-appc - Appcelerator Common Library for Node.js
* Copyright (c) 2009-2014 by Appcelerator, Inc. All Rights Reserved.
* Licensed under the terms of the Apache Public License
* Please see the LICENSE included with this distribution for details.
*/
var appc = require('../index'),
fs = require('fs'),
path = require('path'),
http = require('http'),
temp = require('temp');
// wrench = require('wrench');
describe('auth', function () {
it('namespace exists', function () {
appc.should.have.property('auth');
appc.auth.should.be.an.Object;
});
describe('#login()', function () {
//
});
describe('#logout()', function () {
//
});
describe('#status()', function () {
//
});
describe('#getMID()', function () {
it('creates non-existant mid file', function (done) {
var tempDir = temp.mkdirSync();
appc.auth.getMID(tempDir, function (mid) {
mid.should.be.a.String;
fs.existsSync(path.join(tempDir, 'mid.json')).should.be.ok;
done();
});
});
it('results cached', function (done) {
var tempDir = temp.mkdirSync();
appc.auth.getMID(tempDir, function (result1) {
appc.auth.getMID(tempDir, function (result2) {
result1.should.equal(result2);
done();
});
});
});
});
});