0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-13 06:32:39 +00:00
This commit is contained in:
Scott Tolksdorf
2017-01-01 11:08:08 -08:00
parent 68ecf749ea
commit 25e0a1607a
4 changed files with 31 additions and 8 deletions

View File

@@ -0,0 +1,22 @@
const testing = require('./test.init.js');
const should = testing.should;
const BrewDB = require('../server/brew.data.js');
describe('BrewDB', () => {
it('generates ID on save', (done) => {
return BrewDB.create({
text : "Brew Text"
}).then((brew) => {
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');
});
});
});

View File

@@ -17,13 +17,7 @@ module.exports = {
should: should,
clearCache: () => {
return new Promise((resolve, reject) => {
Cache.getRawClientYesIKnowWhatImDoing()
.flushdb((err) => {
if (err) {
return reject(new Error(err));
}
resolve();
});
return resolve();
});
},
};