Update tests for gitlab

This commit is contained in:
Jonathan Cremin 2016-05-24 18:03:10 +01:00
parent b3479983aa
commit 13400ea4d3
5 changed files with 33 additions and 24 deletions

View file

@ -1,5 +1,12 @@
db.files.createIndex({
"owner": 1,
"status": 1,
"time_added": -1
const MongoClient = require('mongodb').MongoClient;
const url = 'mongodb://localhost:27017/hostr';
MongoClient.connect(url, function connect(err, db) {
const collection = db.collection('files');
collection.createIndex({
'owner': 1,
'status': 1,
'time_added': -1,
});
db.close();
});

View file

@ -1,9 +1,16 @@
db.users.remove({
"email": "test@hostr.co"
});
db.users.save({
"email": "test@hostr.co",
"salted_password": "$pbkdf2-256-1$2$kBhIDRqFwnF/1ms6ZHfME2o2$a48e8c350d26397fcc88bf0a7a2817b1cdcd1ffffe0521a5",
"joined": Math.ceil(Date.now()/1000),
"signup_ip": "127.0.0.1"
const MongoClient = require('mongodb').MongoClient;
const url = 'mongodb://localhost:27017/hostr';
MongoClient.connect(url, function connect(err, db) {
const collection = db.collection('users');
collection.remove({
'email': 'test@hostr.co',
});
collection.save({
'email': 'test@hostr.co',
'salted_password': '$pbkdf2-256-1$2$kBhIDRqFwnF/1ms6ZHfME2o2$a48e8c350d26397fcc88bf0a7a2817b1cdcd1ffffe0521a5',
'joined': Math.ceil(Date.now() / 1000),
'signup_ip': '127.0.0.1',
});
db.close();
});