From ccd3d26059b7b30e70adffea005faf787a703cd5 Mon Sep 17 00:00:00 2001 From: Aram Drevekenin Date: Thu, 19 Jan 2017 17:14:39 +0200 Subject: [PATCH] test: adduser created with htpasswd --- test/functional/adduser.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/functional/adduser.js b/test/functional/adduser.js index 0402f297b..b0c6bcf53 100644 --- a/test/functional/adduser.js +++ b/test/functional/adduser.js @@ -1,4 +1,6 @@ var Server = require('./lib/server') +var fs = require('fs') +var path = require('path') module.exports = function() { var server = new Server('http://localhost:55551/') @@ -26,4 +28,20 @@ module.exports = function() { .body_error(/maximum amount of users reached/) }) }) + + describe('adduser created with htpasswd', function() { + var user = 'preexisting' + var pass = 'preexisting' + before(function () { + return fs.appendFileSync( + path.join(__dirname, 'test-storage', '.htpasswd'), + 'preexisting:$apr1$4YSboUa9$yVKjE7.PxIOuK3M4D7VjX.' + ) + }) + it('should log in', function () { + return server.auth(user, pass) + .status(201) + .body_ok(/you are authenticated as/) + }) + }) }