Started by adding some system tests for the api.
This commit is contained in:
12
seasoned_api/test/helpers/createUser.js
Normal file
12
seasoned_api/test/helpers/createUser.js
Normal file
@@ -0,0 +1,12 @@
|
||||
const User = require('src/user/user');
|
||||
const UserSecurity = require('src/user/userSecurity');
|
||||
const SqliteDatabase = require('src/database/sqliteDatabase');
|
||||
|
||||
function createUser(username, email, password) {
|
||||
const database = new SqliteDatabase(':memory:');
|
||||
const userSecurity = new UserSecurity(database);
|
||||
const user = new User(username, email);
|
||||
return userSecurity.createNewUser(user, password);
|
||||
}
|
||||
|
||||
module.exports = createUser;
|
||||
Reference in New Issue
Block a user