Created
October 8, 2013 16:23
-
-
Save nikaspran/6887324 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*jshint expr:true */ | |
'use strict'; | |
var Entity = require('./../model/Entity')(schema); | |
require('./EntityController')(server, schema); | |
describe('EntityController', function () { | |
it('should GET single', function (done) { | |
var entity = new Entity(); | |
entity.name = 'Test'; | |
entity.type = 'task'; | |
entity.save(function (err, savedEntity) { | |
chai.request(server) | |
.get('/api/entities/' + savedEntity.id) | |
.res(function (res) { | |
expect(res).to.have.status(200); | |
expect(res).to.be.json; | |
expect(res.body.name).to.equal(entity.name); | |
expect(res.body.type).to.equal(entity.type); | |
done(); | |
}); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment