Created a test environment for repeatables

This commit is contained in:
Ruben Vereecken 2014-05-29 11:10:57 +02:00
parent b0666ace0d
commit 2c04025a5a
4 changed files with 15 additions and 6 deletions

View file

@ -57,17 +57,12 @@ _.extend(AchievementSchema.properties,
type: 'object'
properties:
a: {type: 'number', default: 1},
required: ['a']
description: 'f(x) = a * x'
logarithmic:
type:'object'
properties:
a: {type: 'number', default: 1}
b: {type: 'number', default: 1}
required: ['a', 'b']
description: 'f(x) = a * ln(1/b * (x + b))'
]
default: linear: a: 1
)
AchievementSchema.definitions = {}

View file

@ -127,4 +127,6 @@ c.definitions =
lastSent: c.date()
count: {type: 'integer'}
UserSchema.additionalProperties = true # TODO Ruben seriously remove this
module.exports = UserSchema

View file

@ -8,6 +8,7 @@ locale = require 'locale/locale'
Achievement = require '../../models/Achievement'
User = require '../../models/User'
# TODO remove
filterKeyboardEvents = (allowedEvents, func) ->
return (splat...) ->
@ -28,6 +29,16 @@ module.exports = class RootView extends CocoView
initialize: ->
$ =>
# TODO Ruben remove this. Allows for easy testing right now though
btn = $('<a href="#" id="testbtn" class="btn">Increment</a>')
input = $('<input type="text" id="testinp">')
$('body').append(btn)
$('body').append(input)
btn.on 'click', (e) =>
val = input.val()
me.set(val, me.get(val) + 1)
console.debug me.get(val)
me.save()
#test = new Achievement(_id:'537ce4855c91b8d1dda7fda8')
#test.fetch(success:@showNewAchievement)

View file

@ -24,8 +24,9 @@ candidateProperties = [
UserHandler = class UserHandler extends Handler
modelClass: User
# TODO Ruben change this back! Really really do. Don't you dare forget. NO COOKIES
editableProperties: [
'name', 'photoURL', 'password', 'anonymous', 'wizardColor1', 'volume',
'name', 'photoURL', 'password', 'anonymous', 'wizardColor1', 'volume', 'simulatedBy',
'firstName', 'lastName', 'gender', 'facebookID', 'gplusID', 'emails',
'testGroupNumber', 'music', 'hourOfCode', 'hourOfCodeComplete', 'preferredLanguage',
'wizard', 'aceConfig', 'autocastDelay', 'lastLevel', 'jobProfile'