mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-01-27 22:59:51 -05:00
test: adduser created with htpasswd
This commit is contained in:
parent
014a0b53ae
commit
ccd3d26059
1 changed files with 18 additions and 0 deletions
|
@ -1,4 +1,6 @@
|
||||||
var Server = require('./lib/server')
|
var Server = require('./lib/server')
|
||||||
|
var fs = require('fs')
|
||||||
|
var path = require('path')
|
||||||
|
|
||||||
module.exports = function() {
|
module.exports = function() {
|
||||||
var server = new Server('http://localhost:55551/')
|
var server = new Server('http://localhost:55551/')
|
||||||
|
@ -26,4 +28,20 @@ module.exports = function() {
|
||||||
.body_error(/maximum amount of users reached/)
|
.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/)
|
||||||
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue