test: it does not send mail for box patch releases

This commit is contained in:
Girish Ramakrishnan
2016-04-12 13:45:11 -07:00
parent 40dd12ba68
commit 53268b67dc

View File

@@ -54,6 +54,7 @@ var RELEASE_2 = {
var RELEASES = {
"1.0.0": RELEASE_1,
"1.0.1": RELEASE_1,
"2.0.0-pre0": RELEASE_2_PRERELEASE,
"2.0.0": RELEASE_2
};
@@ -183,6 +184,21 @@ describe('updatechecker - checkBoxUpdates', function () {
});
});
it('does not send mail for patch releases', function (done) {
var releaseCopy = deepExtend({}, RELEASES);
releaseCopy['1.0.0'].next = '1.0.1';
var scope = nock('http://localhost:4444')
.get('/release.json')
.reply(200, releaseCopy);
updatechecker.checkBoxUpdates(function (error) {
expect(!error).to.be.ok();
expect(updatechecker.getUpdateInfo().box.version).to.be('1.0.1'); // got the update
checkMails(0, done); // but no email sent since patch release
});
});
it('bad response offers nothing', function (done) {
nock.cleanAll();