2014-06-14 10:37:31 -04:00
|
|
|
PatchesView = require 'views/editor/patches_view'
|
|
|
|
CocoModel = require 'models/CocoModel'
|
|
|
|
|
|
|
|
class BlandModel extends CocoModel
|
|
|
|
@className: 'Bland'
|
|
|
|
@schema: {
|
|
|
|
type: 'object'
|
|
|
|
additionalProperties: false
|
|
|
|
properties:
|
|
|
|
number: {type: 'number'}
|
|
|
|
object: {type: 'object'}
|
|
|
|
string: {type: 'string'}
|
|
|
|
_id: {type: 'string'}
|
|
|
|
}
|
|
|
|
urlRoot: '/db/bland'
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = ->
|
2014-06-16 13:42:28 -04:00
|
|
|
model = new BlandModel({_id:'12345', name:'name', original:'original'})
|
2014-06-14 18:02:14 -04:00
|
|
|
v = new PatchesView(model)
|
|
|
|
v.load()
|
|
|
|
|
2014-06-16 13:42:28 -04:00
|
|
|
# Respond to request for pending patches.
|
2014-06-14 18:02:14 -04:00
|
|
|
r = jasmine.Ajax.requests.mostRecent()
|
2014-06-16 13:42:28 -04:00
|
|
|
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 })
|
|
|
|
|
2014-06-14 18:02:14 -04:00
|
|
|
v.render()
|
|
|
|
v
|
2014-06-14 10:37:31 -04:00
|
|
|
|