add tests for milestones without due date
This commit is contained in:
parent
eca50c0b84
commit
cc7cf05eb5
|
@ -25,6 +25,21 @@ module.exports =
|
|||
assert.equal milestone.number, 1
|
||||
do done
|
||||
|
||||
'milestones - get current from 1 when milestone has no due date': (done) ->
|
||||
req.all_milestones = (opts, cb) ->
|
||||
cb null, [
|
||||
{
|
||||
'number': 1
|
||||
'created_at': '2013-01-01T00:00:00Z'
|
||||
'due_on': null
|
||||
}
|
||||
]
|
||||
|
||||
milestones.get_current {}, (err, warn, milestone) ->
|
||||
assert.ifError err
|
||||
assert.equal milestone.number, 1
|
||||
do done
|
||||
|
||||
# We always take from head because of request params.
|
||||
'milestones - get current from > 1': (done) ->
|
||||
req.all_milestones = (opts, cb) ->
|
||||
|
@ -51,6 +66,31 @@ module.exports =
|
|||
assert.equal milestone.number, 2
|
||||
do done
|
||||
|
||||
'milestones - get current from > 1 when there are milestones without due date': (done) ->
|
||||
req.all_milestones = (opts, cb) ->
|
||||
cb null, [
|
||||
{
|
||||
'number': 2
|
||||
'created_at': '2013-01-01T00:00:00Z'
|
||||
'due_on': null
|
||||
}
|
||||
{
|
||||
'number': 1
|
||||
'created_at': '2013-01-01T00:00:00Z'
|
||||
'due_on': '2013-02-01T00:00:00Z'
|
||||
}
|
||||
{
|
||||
'number': 3
|
||||
'created_at': '2013-01-01T00:00:00Z'
|
||||
'due_on': '2013-02-15T00:00:00Z'
|
||||
}
|
||||
]
|
||||
|
||||
milestones.get_current {}, (err, warn, milestone) ->
|
||||
assert.ifError err
|
||||
assert.equal milestone.number, 1
|
||||
do done
|
||||
|
||||
'milestones - get current when empty': (done) ->
|
||||
req.all_milestones = (opts, cb) ->
|
||||
cb null, []
|
||||
|
|
Loading…
Reference in New Issue