mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 09:35:39 -05:00
Got the PatchView demo working.
This commit is contained in:
parent
ee791da34c
commit
a3af0d2ea5
1 changed files with 18 additions and 3 deletions
|
@ -16,13 +16,28 @@ class BlandModel extends CocoModel
|
|||
|
||||
|
||||
module.exports = ->
|
||||
model = new BlandModel({_id:'12345'})
|
||||
model = new BlandModel({_id:'12345', name:'name', original:'original'})
|
||||
v = new PatchesView(model)
|
||||
v.load()
|
||||
|
||||
# doesn't quite work yet. Intercepts a mixpanel request instead
|
||||
# Respond to request for pending patches.
|
||||
r = jasmine.Ajax.requests.mostRecent()
|
||||
r.send({statusCode:200, responseText:"[]"})
|
||||
patches = [
|
||||
{
|
||||
delta: null
|
||||
commitMessage: 'Demo message'
|
||||
creator: '12345'
|
||||
created: "2014-01-01T12:00:00.000Z"
|
||||
status: 'pending'
|
||||
}
|
||||
]
|
||||
r.response({ status:200, responseText: JSON.stringify patches })
|
||||
|
||||
# Respond to request for user ids -> names
|
||||
r = jasmine.Ajax.requests.mostRecent()
|
||||
names = { '12345': { name: 'Patchman' } }
|
||||
r.response({ status:200, responseText: JSON.stringify names })
|
||||
|
||||
v.render()
|
||||
v
|
||||
|
||||
|
|
Loading…
Reference in a new issue