open or closed empty

This commit is contained in:
Radek Stepan 2013-08-13 14:02:00 +01:00
parent 689f6868a8
commit 8426ee24b6
1 changed files with 30 additions and 0 deletions

View File

@ -22,3 +22,33 @@ module.exports =
assert.equal open.length, 0 assert.equal open.length, 0
assert.equal closed.length, 0 assert.equal closed.length, 0
done.call null done.call null
'open empty': (done) ->
called = 0
req.all_issues = (opts, cb) ->
called += 1
cb null, if called is 1 then [] else [
{ number: 1 }
]
issues.get_all {}, (err, [ open, closed ]) ->
assert.ifError err
assert.equal called, 2
assert.equal open.length, 0
assert.equal closed.length, 1
done.call null
'closed empty': (done) ->
called = 0
req.all_issues = (opts, cb) ->
called += 1
cb null, if called is 2 then [] else [
{ number: 1 }
]
issues.get_all {}, (err, [ open, closed ]) ->
assert.ifError err
assert.equal called, 2
assert.equal open.length, 1
assert.equal closed.length, 0
done.call null