1
0
mirror of https://github.com/stolksdorf/homebrewery.git synced 2025-12-13 20:05:56 +00:00

Triyng to setup api tests

This commit is contained in:
Scott Tolksdorf
2017-01-01 17:06:44 -08:00
parent a0bc4fddf8
commit 537a75b2ab
4 changed files with 43 additions and 10 deletions

View File

@@ -8,20 +8,19 @@ const BrewDB = require('../server/brew.data.js');
describe('BrewDB', () => {
it('generates ID on save', (done) => {
before('Await DB', ()=>{
return require('db.js').connect();
});
it('generates ID on save', () => {
return BrewDB.create({
text : "Brew Text"
}).then((brew) => {
console.log('running?');
should.exist(brew);
brew.should.have.property('editId').that.is.a('string');
brew.should.have.property('shareId').that.is.a('string');
brew.should.have.property('text').that.is.a('string');
done();
})
.catch(()=>{
console.log('yo');
})
});
});
});