todos tests (stub)

This commit is contained in:
Tyler Renelle 2013-01-28 17:43:50 -05:00
parent 4a7b5183f8
commit d5f36a291c

View file

@ -1,18 +1,29 @@
helper = new require('./test/casper/helpers')()
casper = helper.casper
utils = helper.utils
url = helper.url
casper.start url + '/?play=1'
# ---------- Todos ------------
casper.then ->
reset()
addTasks()
helper.reset()
helper.addTasks()
# Gained exp on +daily
casper.then ->
user = userBeforeAfter (-> casper.click '.todos input[type="checkbox"]')
user = helper.userBeforeAfter (-> casper.click '.todos input[type="checkbox"]')
@test.assertEquals user.before.stats.hp, user.after.stats.hp, '+daily =hp'
@test.assert user.before.stats.exp < user.after.stats.exp, '+daily +exp'
@test.assert user.before.stats.money < user.after.stats.money, '+daily +money'
# -daily acts as undo
casper.then ->
user = userBeforeAfter (-> casper.click '.todos input[type="checkbox"]')
user = helper.userBeforeAfter (-> casper.click '.todos input[type="checkbox"]')
@test.assertEquals user.before.stats.hp, user.after.stats.hp, '-daily =hp'
@test.assert user.before.stats.exp > user.after.stats.exp, '-daily -exp'
@test.assert user.before.stats.money > user.after.stats.money, '-daily -money'
@test.assert user.before.stats.money > user.after.stats.money, '-daily -money'
# ---------- Run ------------
casper.run ->
casper.test.renderResults true