From d777314bf114ab0451bfb4f6d893e9bc9815e750 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Mon, 11 Jul 2016 08:51:56 -0700 Subject: [PATCH] (#109) - start trying to test #109 --- test/test.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/test/test.js b/test/test.js index b8f120f..c50a392 100644 --- a/test/test.js +++ b/test/test.js @@ -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; });