more casper testing

This commit is contained in:
Tyler Renelle 2013-01-21 17:16:21 -05:00
parent 3d57894b9e
commit 3d18b462ea

View file

@ -11,19 +11,21 @@ getUser = () -> casper.evaluate -> window.DERBY.app.model.get('_user')
casper.start url, -> casper.start url, ->
@test.assertTitle "HabitRPG | Gamify Your Life", "[√] Page Title" @test.assertTitle "HabitRPG | Gamify Your Life", "[√] Page Title"
# ---------- Remove sample tasks ------------ # ---------- Register ------------
casper.then -> casper.then ->
@evaluate -> @fill 'form#derby-auth-register',
model = window.DERBY.app.model username: 'lefnire'
tasks = model.get('_user.tasks') email: 'x@x.com'
_.each tasks, (task) -> model.remove() 'email-confirmation': 'x@x.com'
model.set '_user.tasks', {} password: 'habitrpg123'
model.set '_user.habitIds', [] , true
model.set '_user.dailyIds', []
model.set '_user.todoIds', [] # Clear tasks
model.set '_user.rewardIds', [] casper.then ->
@then -> @reload() @debugHTML()
# FIXME this function does jack shit @click '#reset-modal button:contains(Reset)'
tasks = @evaluate -> window.DERBY.app.model.get('_user.tasks')
@test.assertEual tasks.length,0
# ---------- Setup Tasks ------------ # ---------- Setup Tasks ------------
casper.then -> casper.then ->