From 13a896e0af723b2098cb83529ccec5ae4d51b456 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Du=C5=A1an=20Jureti=C4=87?= Date: Wed, 5 Mar 2014 22:59:56 -0300 Subject: [PATCH] Tests for spell values checks more attributes --- test/algos.mocha.coffee | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/algos.mocha.coffee b/test/algos.mocha.coffee index 4fe988ca1f..0160780766 100644 --- a/test/algos.mocha.coffee +++ b/test/algos.mocha.coffee @@ -241,8 +241,14 @@ describe 'User', -> describe 'spells', -> _.each shared.content.spells, (spellClass)-> _.each spellClass, (spell)-> - it "#{spell.text} has a valid target", -> + it "#{spell.text} has valid values", -> expect(spell.target).to.match(/^(task|self|party|user)$/) + expect(spell.mana).to.be.an('number') + if spell.lvl + expect(spell.lvl).to.be.an('number') + expect(spell.lvl).to.be.above(0) + expect(spell.cast).to.be.a('function') + describe 'drop system', -> user = null