mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-05 03:52:14 +00:00
Trying out new test to check user balance after creating a challenge with prize.
This commit is contained in:
parent
4085ed5b15
commit
19c2ae415f
1 changed files with 26 additions and 0 deletions
|
|
@ -479,6 +479,32 @@ describe "API", ->
|
||||||
cb()
|
cb()
|
||||||
], done
|
], 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
|
||||||
|
async.parallel [
|
||||||
|
(cb) ->
|
||||||
|
User.findById _id, cb
|
||||||
|
(cb) ->
|
||||||
|
Challenge.findById res.body._id, cb
|
||||||
|
], (err, results) ->
|
||||||
|
_user = results[0]
|
||||||
|
challenge = results[1]
|
||||||
|
expect(_user.balance).to.be 5.5
|
||||||
|
done()
|
||||||
|
|
||||||
|
###*
|
||||||
|
QUESTS
|
||||||
|
###
|
||||||
describe "Quests", ->
|
describe "Quests", ->
|
||||||
party = undefined
|
party = undefined
|
||||||
participating = []
|
participating = []
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue