mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-02-17 08:50:58 -05:00
Created a test environment for repeatables
This commit is contained in:
parent
b0666ace0d
commit
2c04025a5a
4 changed files with 15 additions and 6 deletions
|
@ -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 = {}
|
||||
|
|
|
@ -127,4 +127,6 @@ c.definitions =
|
|||
lastSent: c.date()
|
||||
count: {type: 'integer'}
|
||||
|
||||
UserSchema.additionalProperties = true # TODO Ruben seriously remove this
|
||||
|
||||
module.exports = UserSchema
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
|
@ -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'
|
||||
|
|
Loading…
Reference in a new issue