mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-23 15:48:11 -05:00
Update request, make server tests work with it
This commit is contained in:
parent
eeb6f8c5e9
commit
e1e5b66d7f
10 changed files with 2 additions and 11 deletions
|
@ -78,7 +78,7 @@
|
|||
"passport": "0.1.x",
|
||||
"passport-local": "0.1.x",
|
||||
"redis": "",
|
||||
"request": "2.12.x",
|
||||
"request": "^2.69.0",
|
||||
"sendwithus": "2.1.x",
|
||||
"stream-buffers": "0.2.x",
|
||||
"stripe": "~2.9.0",
|
||||
|
|
|
@ -77,7 +77,6 @@ beforeEach(function(done) {
|
|||
},
|
||||
function(cb) {
|
||||
// Initialize products
|
||||
var request = require('request');
|
||||
request.get(getURL('/db/products'), function(err, res, body) {
|
||||
expect(err).toBe(null);
|
||||
expect(res.statusCode).toBe(200);
|
||||
|
|
|
@ -70,7 +70,7 @@ GLOBAL.saveModels = (models, done) ->
|
|||
|
||||
GLOBAL.simplePermissions = [target: 'public', access: 'owner']
|
||||
GLOBAL.ObjectId = mongoose.Types.ObjectId
|
||||
GLOBAL.request = require 'request'
|
||||
GLOBAL.request = require('request').defaults({jar: true})
|
||||
Promise = require 'bluebird'
|
||||
Promise.promisifyAll(request, {multiArgs: true})
|
||||
|
||||
|
@ -88,7 +88,6 @@ unittest.getUser = (name, email, password, done, force) ->
|
|||
# Creates the user if it doesn't already exist.
|
||||
|
||||
return done(unittest.users[email]) if unittest.users[email] and not force
|
||||
request = require 'request'
|
||||
request.post getURL('/auth/logout'), ->
|
||||
request.get getURL('/auth/whoami'), ->
|
||||
req = request.post(getURL('/db/user'), (err, response, body) ->
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
require '../common'
|
||||
request = require 'request'
|
||||
User = require '../../../server/users/User'
|
||||
|
||||
urlLogin = getURL('/auth/login')
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
require '../common'
|
||||
|
||||
describe '/db/<id>/version', ->
|
||||
request = require 'request'
|
||||
it 'clears the db first', (done) ->
|
||||
clearModels [User, Article], (err) ->
|
||||
throw err if err
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
request = require 'request'
|
||||
require '../common'
|
||||
config = require '../../../server_config'
|
||||
nockUtils = require('../nock-utils')
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
require '../common'
|
||||
|
||||
describe '/db/patch', ->
|
||||
request = require 'request'
|
||||
async = require 'async'
|
||||
UserHandler = require '../../../server/users/user_handler'
|
||||
|
||||
|
|
|
@ -6,7 +6,6 @@ nockUtils = require '../nock-utils'
|
|||
|
||||
|
||||
describe '/db/payment', ->
|
||||
request = require 'request'
|
||||
paymentURL = getURL('/db/payment')
|
||||
checkChargesURL = getURL('/db/payment/check-stripe-charges')
|
||||
customPaymentURL = getURL('/db/payment/custom')
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
require '../common'
|
||||
request = require 'request'
|
||||
User = require '../../../server/users/User'
|
||||
|
||||
urlUser = '/db/user'
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
GLOBAL._ = require 'lodash'
|
||||
|
||||
require '../common'
|
||||
request = require 'request'
|
||||
AnalyticsUsersActive = require '../../../server/analytics/AnalyticsUsersActive'
|
||||
LevelSession = require '../../../server/levels/sessions/LevelSession'
|
||||
User = require '../../../server/users/User'
|
||||
|
|
Loading…
Reference in a new issue