Skip to content

Instantly share code, notes, and snippets.

@RobbertWolfs
Last active October 15, 2015 16:59
Show Gist options
  • Save RobbertWolfs/fde357daf24b2517de46 to your computer and use it in GitHub Desktop.
Save RobbertWolfs/fde357daf24b2517de46 to your computer and use it in GitHub Desktop.
it('should return objects', function () {
var backend = { transfer: sandbox.stub() };
var stub2 = sandbox.stub(repository, 'getMails').returns([
{id: 123, to: '[email protected]', body: 'aaaa...'},
{id: 123, to: '[email protected]', body: 'bbb...'}
]);
mailSystem.transferEuriMails(backend);
expect(stub2).to.have.been.called;
var mails = stub2.returnValues[0][0];
expect(mails).to.include.keys(['to', 'id', 'body']);
expect(backend.transfer).to.have.been.called;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment