Feature: Get a project
As a vision user I want to get a project So that I can monitor the activity of selected repositories
Let's add a test to the existing set of tests ./test/project.js
for our feature Get a project
. This resource will GET a project from route /project/:id
, and return a 200 OK
status.
Let's install underscore.js
; a utility-belt library that provides functional programming support:
npm install underscore --save
describe('when requesting an available resource /project/:id', function(){ it('should respond with 200', function(done){ request(app) .get('/project/' + id) .expect('Content-Type', /json/) .expect(200) .end(function (err, res) { var proj = JSON.parse(res.text); assert.equal(proj._id, id); assert(_.has(proj, '_id')); assert(_.has(proj, 'name')); assert(_.has(proj, 'user')); assert(_.has(proj, 'token')); assert(_.has(proj, 'created')); assert(_.has(proj, 'repositories')); done(); }); }...