Merge branch 'server-test-fix' of https://github.com/rubenvereecken/codecombat into rubenvereecken-server-test-fix

This commit is contained in:
Scott Erickson 2014-06-11 11:39:58 -07:00
commit b81daabaf8
6 changed files with 13 additions and 10 deletions

View file

@ -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)

View file

@ -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()

View file

@ -7,7 +7,7 @@ LevelSystemHandler = class LevelSystemHandler extends Handler
'description'
'code'
'js'
'language'
'codeLanguage'
'dependencies'
'propertyDocumentation'
'configSchema'

View file

@ -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

View file

@ -1,5 +1,4 @@
mongoose = require('mongoose')
User = require('../users/User')
textSearch = require('mongoose-text-search')
module.exports.MigrationPlugin = (schema, migrations) ->

View file

@ -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) ->