UNPKG

swagger

Version:

The Swagger command-line. Provides Swagger utilities and project lifecycle support.

48 lines (33 loc) 1.02 kB
var should = require('should'); var request = require('supertest'); describe('controllers', function() { describe('hello_world', function() { describe('GET /hello', function() { it('should return a default string', function(done) { request(server) .get('/hello') .set('Accept', 'application/json') .expect('Content-Type', /json/) .expect(200) .end(function(err, res) { should.not.exist(err); res.body.should.eql('Hello, stranger!'); done(); }); }); it('should accept a name parameter', function(done) { request(server) .get('/hello') .query({ name: 'Scott'}) .set('Accept', 'application/json') .expect('Content-Type', /json/) .expect(200) .end(function(err, res) { should.not.exist(err); res.body.should.eql('Hello, Scott!'); done(); }); }); }); }); });