describe('slides', function () {

  var Dashboard = require('performanceplatform-client.js');
  var Q = require('q');
  var slides = require('../../src/js/slides.js');
  var container = document.createElement('div');

  beforeEach(function (done) {
    var deferred = Q.defer();

    Dashboard.prototype.getConfig = function () {
      return deferred.promise;
    };

    slides(container).then(function () {
      done();
    });
    deferred.resolve({
      'title': '"Dashboard title"'
    });
  });

  it('should retrieve dashboard config', function () {
    container.innerHTML.should.contain('Performance data for "Dashboard title"');
  });

});


describe('slides', function () {

  var Dashboard = require('performanceplatform-client.js');
  var Q = require('q');
  var slides = require('../../src/js/slides.js');
  var container = document.createElement('div');

  beforeEach(function (done) {
    var deferred = Q.defer();

    sinon.stub(Dashboard.prototype, 'getConfig').returns(deferred.promise);

    slides(container).then(function () {
      done();
    });
    deferred.resolve({
      'title': '"Dashboard title"'
    });
  });

  it('should retrieve dashboard config', function () {
    container.innerHTML.should.contain('Performance data for "Dashboard title"');
  });

});


Use sinon to stub method
Use sinon to stub method
