Fixing mock-http for double digit ids

This commit is contained in:
Matthew Dillon 2015-03-19 11:04:04 -08:00
parent c68f0a0fee
commit 38a382279a
2 changed files with 6 additions and 6 deletions

View file

@ -105,7 +105,7 @@ module.exports = function(app) {
id: 8,
strain: 2,
characteristic: 'Characteristic 3',
textMeasurementType: 'Meas. Type 1',
textMeasurementType: null,
txtValue: "text value",
numValue: null,
confidenceInterval: null,
@ -157,16 +157,16 @@ module.exports = function(app) {
measurementsRouter.get('/:id', function(req, res) {
var measurements = MEASUREMENTS.filter(function(m) {
return req.params.id.indexOf(m.id.toString()) > -1;
return m.id == req.params.id;
});
res.send({
'measurement': measurements[0]
'measurement': measurements
});
});
measurementsRouter.put('/:id', function(req, res) {
var measurements = MEASUREMENTS.filter(function(m) {
return req.params.id.indexOf(m.id.toString()) > -1;
return m.id == req.params.id;
});
res.send({
'measurement': measurements[0]

View file

@ -73,7 +73,7 @@ module.exports = function(app) {
strainsRouter.get('/:id', function(req, res) {
var strains = STRAINS.filter(function(s) {
return req.params.id.indexOf(s.id.toString()) > -1;
return s.id == req.params.id;
});
res.send({
'strain': strains[0]
@ -82,7 +82,7 @@ module.exports = function(app) {
strainsRouter.put('/:id', function(req, res) {
var strains = STRAINS.filter(function(s) {
return req.params.id.indexOf(s.id.toString()) > -1;
return s.id == req.params.id;
});
res.send({
'strain': strains[0]