diff --git a/sample/server.js b/sample/server.js index 543c6b6..62a3f33 100644 --- a/sample/server.js +++ b/sample/server.js @@ -21,11 +21,12 @@ webServer.listen(webAppPort, function () { }); webServer.on('error', onError); -var pouchDBName = 'db'; -if (! fs.existsSync('./' + pouchDBName)){ - fs.mkdirSync('./' + pouchDBName); +// prefix dir should exist. +var prefixDir = './db'; +if (! fs.existsSync(prefixDir)){ + fs.mkdirSync(prefixDir); } -var pbsetup = PouchDB.defaults({ prefix: './' + pouchDBName + '/' }); +var pbsetup = PouchDB.defaults({ prefix: prefixDir + '/' }); var pouchPort = normalizePort(process.env.PORT2 || '3001'); var opts = { @@ -43,7 +44,7 @@ router.all('*', function(req, res, next) { next(); }); //Norml middleware usage.. -router.all('*', acllib(pouchDBName, acl, function (thaliId) { +router.all('*', acllib('foobarrepl', acl, function (thaliId) { debug('thaliId %s', thaliId); })); diff --git a/test/test-core-alldocs.js b/test/test-core-alldocs.js index d5a27e2..07c8d58 100644 --- a/test/test-core-alldocs.js +++ b/test/test-core-alldocs.js @@ -38,7 +38,7 @@ describe('test-core-db-2.js - calling the /db path', function() { //Norml middleware usage..0 var acl = require('./acl-block.1.js'); router.all('*', lib('foobar', acl, function(){})); - //mock handlers + //mock handlers app.use('/', genericHandlers(router, path)); }) @@ -60,7 +60,7 @@ describe('test-core-db-2.js - calling the /db path', function() { .set('Accept', 'application/json') .expect(200, done); }) - it('HEADz should be 200', function(done) { + it('HEAD should be 200', function(done) { request(app) .head(path) .set('Accept', 'application/json') @@ -74,4 +74,3 @@ describe('test-core-db-2.js - calling the /db path', function() { }) }) }) - diff --git a/test/test-noaclfile.js b/test/test-noaclfile.js index b62d409..0122d75 100644 --- a/test/test-noaclfile.js +++ b/test/test-noaclfile.js @@ -44,7 +44,7 @@ describe('test-noaclfile.js - should let all through', function() { before(function() { router.all('*', function(req, res, next) { - req.connection.pskIdentity = 'public'; + req.connection.pskRole = 'public'; next(); }) router.all('*', lib('foobar', [{}], function(){})); @@ -66,7 +66,7 @@ describe('test-noaclfile.js - should let all through', function() { before(function() { //mocker.. router.all('*', function(req, res, next) { - req.connection.pskIdentity = 'user'; + req.connection.pskRole = 'user'; next(); }) //Norml middleware usage.. @@ -82,4 +82,4 @@ describe('test-noaclfile.js - should let all through', function() { .expect(401, done); }) }) -}) \ No newline at end of file +})