0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-13 06:32:39 +00:00

Fixing edge cases in the search tests

This commit is contained in:
Scott Tolksdorf
2017-01-27 19:47:45 -05:00
parent a826aaffd9
commit 26bcb3395a
8 changed files with 80 additions and 43 deletions

View File

@@ -56,6 +56,7 @@ module.exports = {
},
populateDB : (brewCollection)=>{
PopulatedBrews = {};
return Promise.all(_.map(brewCollection, (brewData, id) => {
return BrewData.create(brewData)
.then((brew)=>{
@@ -72,8 +73,7 @@ module.exports = {
const storedBrew = PopulatedBrews[brewId];
if(!storedBrew) return false;
return _.some(this._obj, (brew)=>{
return brew.editId == storedBrew.editId &&
brew.shareId == storedBrew.shareId &&
return brew.shareId == storedBrew.shareId &&
brew.title == storedBrew.title &&
brew.views == storedBrew.views;
});