From 32bcec013fa71666d3ed4a4db9323d4b19b5fcc4 Mon Sep 17 00:00:00 2001 From: NotGonnaGitUs Date: Mon, 4 May 2015 18:52:14 +0530 Subject: [PATCH] Combined both tests because I can't figure out how to pass challenge._id to next test --- test/api.mocha.coffee | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/test/api.mocha.coffee b/test/api.mocha.coffee index c7e64ff025..a8c0237d0a 100644 --- a/test/api.mocha.coffee +++ b/test/api.mocha.coffee @@ -479,7 +479,7 @@ describe "API", -> cb() ], done - it "User creates a challenge with prize", (done) -> + it "User creates a challenge with prize, deletes it, gets refund", (done) -> User.findByIdAndUpdate _id, $set: "balance": 8 @@ -503,15 +503,11 @@ describe "API", -> _user = results[0] challenge = results[1] expect(_user.balance).to.be 5.5 + request.del(baseURL + "/challenges/" + challenge._id).end (res) -> + User.findById _id, (err, user) -> + expect(user.balance).to.be 8 done() - it "User deletes a challenge with prize and gets refund", (done) -> - itThis = this - request.del(baseURL + "/challenges/" + challenge._id).end (res) -> - User.findById _id, (err, user) -> - expect(user.balance).to.be 8 - done() - ###* QUESTS ###