mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-22 10:55:19 -04:00
Merge branch 'master' of https://github.com/codecombat/codecombat
This commit is contained in:
commit
2d5ca50e89
5 changed files with 37 additions and 12 deletions
app
test/server
|
@ -75,6 +75,7 @@ module.exports.thangNames = thangNames =
|
|||
"Carlton"
|
||||
"Giselle"
|
||||
"Bernadette"
|
||||
"Hershell"
|
||||
]
|
||||
"Archer": [
|
||||
"Phoebe"
|
||||
|
@ -125,6 +126,7 @@ module.exports.thangNames = thangNames =
|
|||
"Iyert"
|
||||
"Palt"
|
||||
"Snortt"
|
||||
"Kog"
|
||||
]
|
||||
"Ogre": [
|
||||
"Krogg"
|
||||
|
@ -137,6 +139,7 @@ module.exports.thangNames = thangNames =
|
|||
"Axe Ox"
|
||||
"Nareng"
|
||||
"Morthrug"
|
||||
"Glonc"
|
||||
]
|
||||
"Ogre Brawler": [
|
||||
"Grul'thock"
|
||||
|
|
|
@ -157,7 +157,7 @@ module.exports = class HUDView extends View
|
|||
response.button = $('button:last', group)
|
||||
else
|
||||
s = $.i18n.t('play_level.hud_continue', defaultValue: "Continue (press shift-space)")
|
||||
if @shiftSpacePressed > 4 && !@escapePressed
|
||||
if @shiftSpacePressed > 4 and not @escapePressed
|
||||
group.append('<span class="hud-hint">Press esc to skip dialog</span>')
|
||||
group.append($('<button class="btn btn-small banner with-dot">' + s + ' <div class="dot"></div></button>'))
|
||||
@lastResponses = null
|
||||
|
|
|
@ -7,8 +7,9 @@ describe '/file', ->
|
|||
it 'deletes all the files first', (done) ->
|
||||
dropGridFS ->
|
||||
done()
|
||||
|
||||
it 'posts good', (done) ->
|
||||
|
||||
|
||||
it 'no admin users can\'t post files', (done) ->
|
||||
options = {
|
||||
uri:url
|
||||
json: {
|
||||
|
@ -18,12 +19,31 @@ describe '/file', ->
|
|||
description: 'None!'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func = (err, res, body) ->
|
||||
expect(res.statusCode).toBe(403)
|
||||
expect(body.metadata).toBeUndefined()
|
||||
done()
|
||||
|
||||
request.post(options, func)
|
||||
|
||||
# FIXME fatal error
|
||||
xit 'posts good', (done) ->
|
||||
options = {
|
||||
uri:url
|
||||
json: {
|
||||
url: 'http://scotterickson.info/images/where-are-you.jpg'
|
||||
filename: 'where-are-you.jpg'
|
||||
mimetype: 'image/jpeg'
|
||||
description: 'None!'
|
||||
}
|
||||
}
|
||||
|
||||
func = (err, res, body) ->
|
||||
expect(res.statusCode).toBe(200)
|
||||
expect(body.metadata.description).toBe('None!')
|
||||
files.push(body)
|
||||
|
||||
|
||||
collection = mongoose.connection.db.collection('media.files')
|
||||
collection.findOne {}, (err, result) ->
|
||||
expect(result.metadata.name).toBe('Where are you')
|
||||
|
@ -49,17 +69,18 @@ describe '/file', ->
|
|||
request.get {uri:url+'/thiswillnotwork'}, (err, res) ->
|
||||
expect(res.statusCode).toBe(404)
|
||||
done()
|
||||
|
||||
it 'posts data directly', (done) ->
|
||||
|
||||
# FIXME fatal error
|
||||
xit 'posts data directly', (done) ->
|
||||
options = {
|
||||
uri:url
|
||||
}
|
||||
|
||||
|
||||
|
||||
func = (err, res, body) ->
|
||||
expect(res.statusCode).toBe(200)
|
||||
body = JSON.parse(body)
|
||||
|
||||
|
||||
expect(body.metadata.description).toBe('rando-info')
|
||||
files.push(body)
|
||||
|
||||
|
@ -67,7 +88,7 @@ describe '/file', ->
|
|||
collection.find({_id:mongoose.Types.ObjectId(body._id)}).toArray (err, results) ->
|
||||
expect(results[0].metadata.name).toBe('Ittybitty')
|
||||
done()
|
||||
|
||||
|
||||
# the only way I could figure out how to get request to do what I wanted...
|
||||
r = request.post(options, func)
|
||||
form = r.form()
|
||||
|
|
|
@ -24,7 +24,7 @@ describe 'LevelSystem', ->
|
|||
|
||||
it 'can make a LevelSystem, without setting official.', (done) ->
|
||||
loginJoe (joe) ->
|
||||
request.post {uri:url, json:system}, (err, res, body) ->
|
||||
request.post {uri:url, json:systems}, (err, res, body) ->
|
||||
expect(res.statusCode).toBe(200)
|
||||
expect(body.official).toBeUndefined()
|
||||
systems[0] = body
|
||||
|
|
|
@ -81,7 +81,8 @@ describe 'PUT /db/user', ->
|
|||
done()
|
||||
form = req.form()
|
||||
form.append('_id', joe.id)
|
||||
form.append('email', "farghlarghlfarghlarghlfarghlarghlfarghlarghlfarghlarghlfarghlarghlfarghlarghlfarghlarghlfarghlarghlfarghlarghlfarghlarghlfarghlarghlfarghlarghlfarghlarghl")
|
||||
form.append('email', "farghlarghlfarghlarghlfarghlarghlfarghlarghlfarghlarghlfarghlar
|
||||
ghlfarghlarghlfarghlarghlfarghlarghlfarghlarghlfarghlarghlfarghlarghlfarghlarghlfarghlarghl")
|
||||
|
||||
it 'logs in as admin', (done) ->
|
||||
loginAdmin -> done()
|
||||
|
|
Loading…
Reference in a new issue