Files
deployd/test/model.test.js
Ritchie Martori c96b224a9f model tests
2011-10-17 17:59:18 -07:00

49 lines
878 B
JavaScript

// deps
require('spawn');
var Model = require('model')
, TestModel = Model.spawn({
collection: 'tests',
})
, data = {id: 1234, foo: 'bar', bat: 'baz'}
;
module.exports = {
'creating a new model': function(done, assert) {
var m = TestModel
.spawn()
.set(data)
.notify(function(json) {
console.log('json', json);
assert.eql(json, data);
})
.save()
;
console.log(m);
},
// 'find and update': function(done, assert) {
// TestModel
// .spawn()
// .set(data)
// .notify(function(json) {
// assert.eql(json, data);
// })
// .fetch()
// ;
// },
//
// 'remove': function(done, assert) {
// TestModel
// .spawn()
// .set(data)
// .notify(function(json) {
// assert.ok(json.removed);
// })
// ;
// }
}