2017-12-02 05:19:08 -05:00
|
|
|
export default function(server) {
|
|
|
|
describe('npm adduser', () => {
|
2017-04-19 14:15:28 -05:00
|
|
|
const user = String(Math.random());
|
|
|
|
const pass = String(Math.random());
|
2018-01-27 20:40:07 -05:00
|
|
|
|
2017-12-02 05:19:08 -05:00
|
|
|
beforeAll(function() {
|
2015-04-11 12:11:04 -05:00
|
|
|
return server.auth(user, pass)
|
|
|
|
.status(201)
|
2017-04-19 14:15:28 -05:00
|
|
|
.body_ok(/user .* created/);
|
|
|
|
});
|
2014-07-22 16:45:28 -05:00
|
|
|
|
2017-12-02 05:19:08 -05:00
|
|
|
test('should create new user', () => {});
|
2014-07-22 16:45:28 -05:00
|
|
|
|
2017-12-02 05:19:08 -05:00
|
|
|
test('should log in', () => {
|
2015-04-11 12:11:04 -05:00
|
|
|
return server.auth(user, pass)
|
|
|
|
.status(201)
|
2017-04-19 14:15:28 -05:00
|
|
|
.body_ok(/you are authenticated as/);
|
|
|
|
});
|
2014-07-22 16:45:28 -05:00
|
|
|
|
2017-12-02 05:19:08 -05:00
|
|
|
test('should not register more users', () => {
|
2015-04-11 12:11:04 -05:00
|
|
|
return server.auth(String(Math.random()), String(Math.random()))
|
|
|
|
.status(409)
|
2017-04-19 14:15:28 -05:00
|
|
|
.body_error(/maximum amount of users reached/);
|
|
|
|
});
|
|
|
|
});
|
2017-12-02 05:19:08 -05:00
|
|
|
}
|