Added tests for challenge task scoring and moved scoring code to model

This commit is contained in:
Keith Holliday
2016-03-18 14:00:14 -05:00
parent 99ff440abc
commit b46219adc5
6 changed files with 265 additions and 42 deletions

View File

@@ -1,21 +1,7 @@
import { preenHistory } from '../../../../../website/src/libs/api-v3/preening';
import moment from 'moment';
import sinon from 'sinon'; // eslint-disable-line no-shadow
function generateHistory (days) {
let history = [];
let now = Number(moment().toDate());
while (days > 0) {
history.push({
value: days,
date: Number(moment(now).subtract(days, 'days').toDate()),
});
days--;
}
return history;
}
import { generateHistory } from '../../../../helpers/api-unit.helper.js';
describe('preenHistory', () => {
let clock;