From 432ab0dc6625f72d8f912818449318d9f699b90e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Du=C5=A1an=20Jureti=C4=87?= Date: Wed, 22 Jan 2014 22:40:12 -0300 Subject: [PATCH] Test quests valid values --- tests/algos.mocha.coffee | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tests/algos.mocha.coffee b/tests/algos.mocha.coffee index 41e9da3071..afb1d4e322 100644 --- a/tests/algos.mocha.coffee +++ b/tests/algos.mocha.coffee @@ -287,6 +287,25 @@ describe 'User', -> user.fns.randomVal.restore() user.fns.predictableRandom.restore() + describe 'Quests', -> + _.each shared.content.quests, (quest)-> + it "#{quest.text} has valid values", -> + expect(quest.notes).to.be.an('string') + expect(quest.completion).to.be.an('string') if quest.completion + expect(quest.previous).to.be.an('string') if quest.previous + expect(quest.value).to.be.greaterThan 0 + expect(quest.drop.gp).to.be.greaterThan 0 + expect(quest.drop.exp).to.be.greaterThan 0 + expect(quest.drop.items).to.be.an(Array) + if quest.boss + expect(quest.boss.name).to.be.an('string') + expect(quest.boss.hp).to.be.greaterThan 0 + expect(quest.boss.str).to.be.greaterThan 0 + else if quest.collect + _.each quest.collect, (collect)-> + expect(collect.text).to.be.an('string') + expect(collect.count).to.be.greaterThan 0 + describe 'Simple Scoring', -> beforeEach -> {@before, @after} = beforeAfter()