0
Fork 0
mirror of https://github.com/verdaccio/verdaccio.git synced 2025-01-20 22:52:46 -05:00

test: adduser created with htpasswd

This commit is contained in:
Aram Drevekenin 2017-01-19 17:14:39 +02:00
parent 014a0b53ae
commit ccd3d26059

View file

@ -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/)
})
})
}