Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Here is the code:
- var assert = require("assert");
- var superagent = require("superagent");
- var should = require("should");
- var expect = require('expect');
- var chai = require('chai');
- var chaiHttp = require('chai-http');
- var request=require('request');
- describe('creating an Incident', function() {
- it('should pass the parameters needed for creating an Incident', function(done) {
- superagent
- .post('http://localhost:9001/incident/create' )
- .send({user: 'user123',password: 'pass123'}) //authorization details
- .set('Accept', 'application/json') //headers
- .set('Content-Type', 'application/json') //headers
- .send({ Name:'MyIncident', orderId:'12340508'}) //JSON parameters to be passed for creating an incident.
- .end(function(err, res) {
- expect(200,done); //Status code
- if (err) {
- throw err;
- }
- else {
- res.should.have.status(400);
- done();
- }
- });
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement