Return version numbers of updates

This commit is contained in:
James Allen 2014-03-06 11:00:49 +00:00
parent aadce232a1
commit 5fc139db00
3 changed files with 4 additions and 0 deletions

View file

@ -42,6 +42,7 @@ module.exports = HttpController =
formattedUpdates = for update in updates formattedUpdates = for update in updates
{ {
meta: update.meta meta: update.meta
v: update.v
} }
res.send JSON.stringify updates: formattedUpdates res.send JSON.stringify updates: formattedUpdates

View file

@ -50,9 +50,11 @@ describe "Getting updates", ->
start_ts: @to start_ts: @to
end_ts: @to end_ts: @to
user_id: @user_id user_id: @user_id
v: 5
}, { }, {
meta: meta:
start_ts: @to - 2 * @minutes start_ts: @to - 2 * @minutes
end_ts: @to - 2 * @minutes end_ts: @to - 2 * @minutes
user_id: @user_id user_id: @user_id
v: 4
}] }]

View file

@ -90,5 +90,6 @@ describe "HttpController", ->
updates = for update in @rawUpdates updates = for update in @rawUpdates
{ {
meta: @meta meta: @meta
v: @v
} }
@res.send.calledWith(JSON.stringify(updates: updates)).should.equal true @res.send.calledWith(JSON.stringify(updates: updates)).should.equal true