stabilize concurrency tests

This commit is contained in:
oleg 2015-07-04 00:03:14 +03:00
parent c7447766c7
commit 6180f2cde4

View File

@ -37,12 +37,8 @@ describe('Db concurrency', function() {
); );
}); });
it('first build should have id 1', function() { it('shoud have ids 1, 2', function() {
expect(firstBuild.id).equal(1); expect(_([firstBuild.id, secondBuild.id]).sortBy()).eql([1, 2]);
});
it('secondBuild build should have id 2', function() {
expect(secondBuild.id).equal(2);
}); });
}); });
@ -68,11 +64,10 @@ describe('Db concurrency', function() {
); );
}); });
_(builds).each(function(build, index) { it('shoud have ids 3, 4, 5', function() {
var number = (index + 1); expect(_(builds).chain().pluck('id').sortBy().value()).eql(
it('build ' + number + ' should have number ' + number, function() { [3, 4, 5]
expect(build.number).equal(number); );
});
}); });
}); });