mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-27 17:45:40 -05:00
Cleaned up achievement testing environment
Made sure server sided tests work completely
This commit is contained in:
parent
2a5c2020ca
commit
aecf937722
5 changed files with 15 additions and 17 deletions
|
@ -33,3 +33,11 @@ block content
|
|||
a(href="/admin/base", data-i18n="admin.av_other_debug_base_url") Base (for debugging base.jade)
|
||||
li
|
||||
a(href="/admin/clas", data-i18n="admin.clas") CLAs
|
||||
|
||||
hr
|
||||
|
||||
h3 Achievements
|
||||
p This is just some stuff for temporary achievement testing. Should be replaced by a demo system.
|
||||
|
||||
input#increment-field(type="text")
|
||||
a.btn.btn-secondary#increment-button(href="#") Increment
|
||||
|
|
|
@ -8,6 +8,7 @@ module.exports = class AdminView extends View
|
|||
|
||||
events:
|
||||
'click #enter-espionage-mode': 'enterEspionageMode'
|
||||
'click #increment-button': 'incrementUserAttribute'
|
||||
|
||||
enterEspionageMode: ->
|
||||
userEmail = $("#user-email").val().toLowerCase()
|
||||
|
@ -29,3 +30,8 @@ module.exports = class AdminView extends View
|
|||
|
||||
espionageFailure: (jqxhr, status,error)->
|
||||
console.log "There was an error entering espionage mode: #{error}"
|
||||
|
||||
incrementUserAttribute: (e) ->
|
||||
val = $('#increment-field').val()
|
||||
me.set(val, me.get(val) + 1)
|
||||
me.save()
|
||||
|
|
|
@ -26,20 +26,6 @@ module.exports = class RootView extends CocoView
|
|||
subscriptions:
|
||||
'achievements:new': 'handleNewAchievements'
|
||||
|
||||
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)
|
||||
|
||||
showNewAchievement: (achievement, earnedAchievement) ->
|
||||
currentLevel = me.level()
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
mongoose = require 'mongoose'
|
||||
jsonschema = require '../../app/schemas/models/earned_achievement'
|
||||
User = require '../users/User'
|
||||
|
||||
EarnedAchievementSchema = new mongoose.Schema({
|
||||
created:
|
||||
|
|
|
@ -24,9 +24,8 @@ 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', 'simulatedBy',
|
||||
'name', 'photoURL', 'password', 'anonymous', 'wizardColor1', 'volume',
|
||||
'firstName', 'lastName', 'gender', 'facebookID', 'gplusID', 'emails',
|
||||
'testGroupNumber', 'music', 'hourOfCode', 'hourOfCodeComplete', 'preferredLanguage',
|
||||
'wizard', 'aceConfig', 'autocastDelay', 'lastLevel', 'jobProfile'
|
||||
|
|
Loading…
Reference in a new issue