Feature: Create a project
As a vision user I want to create a new project So that I can monitor the activity of multiple repositories
Let's add a test to our existing set of tests for our feature Create a project
. This resource will POST a project to the route /project
and return a 201 Created
status code. The following test: ./test/project.js
is the 201 Created
test.
Tip
This book will not document the full set of tests for a feature. Please refer to the source code for the full set of tests.
In this example, SuperTest executes an end
function that returns a response; this allows us to check the headers and body of the response.
describe('when creating a new resource /project', function(){ var project = { name: "new project" , user: login.user , token: login.token , repositories : [ "12345", "9898" ] }; it('should respond with 201', function(done){ request(app) .post('/project') .send(project) .expect('Content-Type', /json/) .expect(201) .end...