Skip to content

Instantly share code, notes, and snippets.

@nikaspran
Created October 8, 2013 16:23
Show Gist options
  • Save nikaspran/6887324 to your computer and use it in GitHub Desktop.
Save nikaspran/6887324 to your computer and use it in GitHub Desktop.
/*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