mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-23 15:48:11 -05:00
Merge branch 'rubenvereecken-server-test-fix'
This commit is contained in:
commit
7fd87f2605
6 changed files with 13 additions and 10 deletions
|
@ -1,5 +1,4 @@
|
|||
mongoose = require('mongoose')
|
||||
plugins = require('../plugins/plugins')
|
||||
jsonschema = require('../../app/schemas/models/achievement')
|
||||
log = require 'winston'
|
||||
|
||||
|
@ -29,7 +28,9 @@ AchievementSchema.pre('save', (next) ->
|
|||
next()
|
||||
)
|
||||
|
||||
module.exports = Achievement = mongoose.model('Achievement', AchievementSchema)
|
||||
|
||||
plugins = require('../plugins/plugins')
|
||||
|
||||
AchievementSchema.plugin(plugins.NamedPlugin)
|
||||
AchievementSchema.plugin(plugins.SearchablePlugin, {searchable: ['name']})
|
||||
|
||||
module.exports = Achievement = mongoose.model('Achievement', AchievementSchema)
|
||||
|
|
|
@ -9,7 +9,7 @@ LevelComponentHandler = class LevelComponentHandler extends Handler
|
|||
'description'
|
||||
'code'
|
||||
'js'
|
||||
'language'
|
||||
'codeLanguage'
|
||||
'dependencies'
|
||||
'propertyDocumentation'
|
||||
'configSchema'
|
||||
|
@ -25,4 +25,4 @@ LevelComponentHandler = class LevelComponentHandler extends Handler
|
|||
req.method is 'GET' or req.user?.isAdmin()
|
||||
|
||||
|
||||
module.exports = new LevelComponentHandler()
|
||||
module.exports = new LevelComponentHandler()
|
||||
|
|
|
@ -7,7 +7,7 @@ LevelSystemHandler = class LevelSystemHandler extends Handler
|
|||
'description'
|
||||
'code'
|
||||
'js'
|
||||
'language'
|
||||
'codeLanguage'
|
||||
'dependencies'
|
||||
'propertyDocumentation'
|
||||
'configSchema'
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
mongoose = require('mongoose')
|
||||
Achievement = require('../achievements/Achievement')
|
||||
EarnedAchievement = require '../achievements/EarnedAchievement'
|
||||
User = require '../users/User'
|
||||
LocalMongo = require '../../app/lib/LocalMongo'
|
||||
util = require '../../app/lib/utils'
|
||||
log = require 'winston'
|
||||
|
@ -19,6 +18,8 @@ loadAchievements = ->
|
|||
loadAchievements()
|
||||
|
||||
module.exports = AchievablePlugin = (schema, options) ->
|
||||
User = require '../users/User'
|
||||
|
||||
checkForAchievement = (doc) ->
|
||||
collectionName = doc.constructor.modelName
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
mongoose = require('mongoose')
|
||||
User = require('../users/User')
|
||||
textSearch = require('mongoose-text-search')
|
||||
|
||||
module.exports.MigrationPlugin = (schema, migrations) ->
|
||||
|
|
|
@ -6,7 +6,8 @@ describe '/file', ->
|
|||
options = {
|
||||
uri:url
|
||||
json: {
|
||||
url: 'http://scotterickson.info/images/where-are-you.jpg'
|
||||
# url: 'http://scotterickson.info/images/where-are-you.jpg'
|
||||
url: 'http://fc07.deviantart.net/fs37/f/2008/283/5/1/Chu_Chu_Pikachu_by_angelishi.gif'
|
||||
filename: 'where-are-you.jpg'
|
||||
mimetype: 'image/jpeg'
|
||||
description: 'None!'
|
||||
|
@ -20,7 +21,8 @@ describe '/file', ->
|
|||
filename: 'ittybitty.data'
|
||||
mimetype: 'application/octet-stream'
|
||||
description: 'rando-info'
|
||||
my_buffer_url: 'http://scotterickson.info/images/where-are-you.jpg'
|
||||
# my_buffer_url: 'http://scotterickson.info/images/where-are-you.jpg'
|
||||
my_buffer_url: 'http://fc07.deviantart.net/fs37/f/2008/283/5/1/Chu_Chu_Pikachu_by_angelishi.gif'
|
||||
}
|
||||
|
||||
it 'preparing test : deletes all the files first', (done) ->
|
||||
|
|
Loading…
Reference in a new issue