-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
michael pearson
committed
Sep 22, 2013
1 parent
6281534
commit 4a4c549
Showing
9 changed files
with
749 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
var bootstrap = require(__dirname + '/../../src/bootstrap'), | ||
dao = bootstrap.app.dao, | ||
assert = require('assert'), | ||
should = require('should'), | ||
uuid = require('node-uuid'), | ||
accountInfo; | ||
|
||
describe('bootstrap', function() { | ||
it('can bootstrap', function(done) { | ||
this.timeout(0); | ||
dao.on('ready', function() { | ||
done(); | ||
}); | ||
}); | ||
|
||
it('has queues', function(done) { | ||
this.timeout(0); | ||
bootstrap.app.bastion.on('readyQueue', function(queueName) { | ||
if ('queue_jobs' === queueName) { | ||
done(); | ||
} | ||
}); | ||
}); | ||
|
||
it('can compile an accountInfo object', function(done) { | ||
dao.checkAuth( | ||
GLOBAL.CFG.testing_user.username, | ||
GLOBAL.CFG.testing_user.password, | ||
'token', | ||
function(err, acct) { | ||
if (err) { | ||
done(err); | ||
} else { | ||
acct.should.be.ok; | ||
acct.user.username.should.equal(GLOBAL.CFG.testing_user.username); | ||
|
||
// assert expected object structure and interface | ||
acct.should.have.ownProperty('user'); | ||
acct.user.should.have.ownProperty('id'); | ||
acct.user.settings.should.be.a('object'); | ||
|
||
acct.user.domains.should.be.a('object'); | ||
acct.user.domains.set.should.be.a('function'); | ||
acct.user.domains.get.should.be.a('function'); | ||
acct.user.domains.test.should.be.a('function'); | ||
|
||
acct.user.channels.should.be.a('object'); | ||
acct.user.channels.set.should.be.a('function'); | ||
acct.user.channels.get.should.be.a('function'); | ||
acct.user.channels.test.should.be.a('function'); | ||
|
||
Object.keys(acct.user.domains).should.not.be.empty; | ||
|
||
accountInfo = acct; | ||
done(); | ||
} | ||
} | ||
); | ||
}); | ||
}); | ||
|
||
|
||
/* | ||
describe('bips', function() { | ||
it('can save a bip', function(done) { | ||
this.timeout(0); | ||
var bip = { | ||
type : 'http', | ||
hub : { | ||
source : { | ||
// edges : [ cid ] | ||
edges : [ '88013839-3932-4083-ae67-fb02f3f32b92' ] | ||
} | ||
} | ||
}, | ||
model = dao.modelFactory('bip', bip, accountInfo, true); | ||
dao.create(model, function(err, result) { | ||
console.log(err); | ||
console.log(result); | ||
done(!err && result); | ||
}, accountInfo); | ||
}); | ||
}); | ||
*/ | ||
describe('retrieve a pod', function() { | ||
it('contains expected attributes', function(done) { | ||
dao.pod('facebook').should.have.ownProperty('_description'); | ||
dao.pod('facebook').should.have.ownProperty('_description'); | ||
done(); | ||
}); | ||
}); |
Oops, something went wrong.