text: 'use strict';
  
  const _ = require('lodash'),
    apiAccepts = require('../../fixtures/api-accepts'),
    endpointName = _.startCase(__dirname.split('/').pop()),
    filename = _.startCase(__filename.split('/').pop().split('.').shift()),
    sinon = require('sinon');
  
  describe(endpointName, function () {
    describe(filename, function () {
      let sandbox,
        hostname = 'localhost.example.com',
        acceptsJson = apiAccepts.acceptsJson(_.camelCase(filename)),
        acceptsJsonBody = apiAccepts.acceptsJsonBody(_.camelCase(filename)),
        acceptsHtml = apiAccepts.acceptsHtml(_.camelCase(filename));
  
      beforeEach(function () {
        sandbox = sinon.sandbox.create();
        sandbox.useFakeTimers();
      });
  
      afterEach(function () {
        sandbox.restore();
      });
  
      describe('/schedule', function () {
        const path = this.title;
  
        beforeEach(function () {
          return apiAccepts.beforeEachTest({ sandbox, hostname });
        });
  
        acceptsJson(path, {}, 405, { allow:['get', 'post'], code: 405, message: 'Method PUT not allowed' });
        acceptsJsonBody(path, {}, {}, 405, { allow:['get', 'post'], code: 405, message: 'Method PUT not allowed' });
        acceptsHtml(path, {}, 405, '405 Method PUT not allowed');
      });
  
      describe('/schedule/:name', function () {
        const path = this.title;
  
        beforeEach(function () {
          return apiAccepts.beforeEachTest({ sandbox, hostname });
        });
  
        acceptsJson(path, {}, 405, { allow:['get', 'delete'], code: 405, message: 'Method PUT not allowed' });
        acceptsJsonBody(path, {}, {}, 405, { allow:['get', 'delete'], code: 405, message: 'Method PUT not allowed' });
        acceptsHtml(path, {}, 405, '405 Method PUT not allowed');
      });
    });
  });