/**
 * Copyright 2015 IBM Corp. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

'use strict';

var app = require('../app');
var request = require('supertest');

describe('POST /api/message', function() {
  it('GET to / should load the home page', function(done) {
    request(app).get('/').expect(200, done);
  });
  // it('Generate Error when no content passed', function(done) {
  //   request(app).post('/api/message').expect(500, done);
  // });
  // it('Generate 200 when passing in context', function(done) {
  //   request(app).post('/api/message').send('{"context":{}, "input":{"text": "Hi"}}').expect(200, done);
  // });
});

@@ -662,68 +662,135 @@
 var 
-request = require('supertest');%0A%0Adescribe('POST /api/message
+bodyParser = require('body-parser')%0Avar request = require('supertest');%0A%0Aapp.use(bodyParser.json());%0A%0Adescribe('Basic API tests
 ', f
@@ -916,54 +916,63 @@
 %7D);%0A
+%0A
  
- //
  it('
-Generate Error when no content passed
+POST to /api/message should return error message
 ', f
@@ -980,35 +980,32 @@
 nction(done) %7B%0A 
- //
    request(app).
@@ -995,32 +995,39 @@
     request(app)
+%0A      
 .post('/api/mess
@@ -1035,189 +1035,453 @@
 ge')
-.expect(500, done);%0A  // %7D);%0A  // it('Generate 200 when passing in context', function(done) %7B%0A  //   request(app).post('/api/message').send('%7B%22context%22:%7B%7D, %22input%22:%7B%22text%22: %22Hi%22%7D%7D')
+%0A      .set('Accept', /application%5C/json/)%0A      .expect('Content-Type', /application%5C/json/)%0A      .send(%7B'input': %7B'text': 'some random text'%7D%7D)%0A      .expect(function(res)%7B%0A        if(!res.body) throw new Error(%22Body was not present in response%22);%0A        if(!res.body.output) throw new Error(%22%5C'Output%5C' was not present in response%22);%0A        if(!res.body.output.text) throw new Error(%22%5C'text%5C' was not present in response%22);%0A      %7D)%0A      
 .exp
@@ -1501,11 +1501,8 @@
 );%0A 
- //
  %7D);

Increase code coverage