mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-05 03:52:14 +00:00
Updated test to see if it works
This commit is contained in:
parent
19c2ae415f
commit
8fae71d7ef
1 changed files with 17 additions and 15 deletions
|
|
@ -480,24 +480,26 @@ describe "API", ->
|
|||
], done
|
||||
|
||||
it "Creates a challenge with prize", (done) ->
|
||||
(cb) ->
|
||||
User.findByIdAndUpdate _id,
|
||||
$set:
|
||||
"balance": 8
|
||||
, cb
|
||||
request.post(baseURL + "/challenges").send(
|
||||
group: group._id
|
||||
prize: 10
|
||||
official: true
|
||||
).end (res) ->
|
||||
expectCode res, 200
|
||||
, (err, _user) ->
|
||||
expect(err).to.not.be.ok()
|
||||
async.parallel [
|
||||
(cb) ->
|
||||
User.findById _id, cb
|
||||
request.post(baseURL + "/challenges").send(
|
||||
group: group._id
|
||||
dailys: []
|
||||
todos: []
|
||||
rewards: []
|
||||
habits: []
|
||||
prize: 10
|
||||
).end (res) ->
|
||||
expect(res.body.prize).to.be 10
|
||||
cb()
|
||||
(cb) ->
|
||||
Challenge.findById res.body._id, cb
|
||||
], (err, results) ->
|
||||
_user = results[0]
|
||||
Challenge.findById group._id, cb
|
||||
], (err, result) ->
|
||||
challenge = results[1]
|
||||
expect(_user.balance).to.be 5.5
|
||||
done()
|
||||
|
|
|
|||
Loading…
Reference in a new issue