Skip to content

Commit

Permalink
(#109) - start trying to test #109
Browse files Browse the repository at this point in the history
  • Loading branch information
nolanlawson committed Jul 11, 2016
1 parent f1ae5db commit d777314
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,26 @@ var users = ['batman', 'superman', 'green_lantern', 'robin', 'aquaman', 'spiderm

var testCases = [
'normal',
'trailing-slash'
'trailing-slash',
'basic-auth'
];

testCases.forEach(function (testCase) {

describe('authentication-' + testCase, function () {

var dbName = testCase === 'normal' ?
var dbName = testCase === 'normal' || testCase === 'basic-auth' ?
'http://localhost:5984/testdb' :
'http://localhost:5984/testdb/'; // trailing slash
'http://localhost:5984/testdb/'; // trailing slash

var db;

beforeEach(function () {
if (testCase === 'basic-auth') {
return new PouchDB(dbName).signup('admin2', 'password').then(function () {
db = new PouchDB(dbName.replace('http://', 'http://admin2:password@'));
});
}
db = new PouchDB(dbName);
return db;
});
Expand Down

0 comments on commit d777314

Please sign in to comment.