'use strict';

var assert = require('assert');
var sinon = require('sinon');

var Changelog = require('../../lib/endpoints/changelog');
var Request = require('../../lib/request');

describe('endpoints/changelog', function () {
    describe('api', function () {
        it('should set the request URL', function () {
            var request = new Request();
            var changelog;
            var stub;

            stub = sinon.stub(request, 'get', function (url) {
                assert.strictEqual(url, '/changelog/api');
            });

            changelog = new Changelog(request);
            changelog.api();

            assert.ok(stub.called);
        });
    });

    describe('controlPanel', function () {
        it('should set the request URL', function () {
            var request = new Request();
            var changelog;
            var stub;

            stub = sinon.stub(request, 'get', function (url) {
                assert.strictEqual(url, '/changelog/controlpanel');
            });

            changelog = new Changelog(request);
            changelog.controlPanel();

            assert.ok(stub.called);
        });
    });
});

'use strict';

const assert = require('assert');
const sinon = require('sinon');

const Changelog = require('../../lib/endpoints/changelog');
const Request = require('../../lib/request');

describe('endpoints/changelog', () => {
    describe('api', () => {
        it('should set the request URL', () => {
            const request = new Request();
            const changelog = new Changelog(request);
            const stub = sinon.stub(request, 'get', (url) => {
                assert.strictEqual(url, '/changelog/api');
            });

            changelog.api();

            assert.ok(stub.called);
        });
    });

    describe('controlPanel', () => {
        it('should set the request URL', () => {
            const request = new Request();
            const changelog = new Changelog(request);
            const stub = sinon.stub(request, 'get', (url) => {
                assert.strictEqual(url, '/changelog/controlpanel');
            });

            changelog.controlPanel();

            assert.ok(stub.called);
        });
    });
});

Rewrite Changelog tests to ES2015
Rewrite Changelog tests to ES2015
