2016-05-09 18:16:54 -04:00
|
|
|
utils = require '../utils'
|
|
|
|
sendwithus = require '../../../server/sendwithus'
|
|
|
|
request = require '../request'
|
|
|
|
User = require '../../../server/models/User'
|
|
|
|
|
2016-05-25 19:54:14 -04:00
|
|
|
# TODO: need to update this test since /contact calls external Close.io API now
|
2016-06-17 13:35:22 -04:00
|
|
|
#xdescribe 'POST /contact', ->
|
|
|
|
#
|
|
|
|
# beforeEach utils.wrap (done) ->
|
|
|
|
# spyOn(sendwithus.api, 'send')
|
|
|
|
# @teacher = yield utils.initUser({role: 'teacher'})
|
|
|
|
# yield utils.loginUser(@teacher)
|
|
|
|
# done()
|
|
|
|
#
|
|
|
|
# describe 'when recipientID is "schools@codecombat.com"', ->
|
|
|
|
# it 'sends to that email', utils.wrap (done) ->
|
|
|
|
# [res, body] = yield request.postAsync({url: getURL('/contact'), json: {
|
|
|
|
# sender: 'some@email.com'
|
|
|
|
# message: 'A message'
|
|
|
|
# recipientID: 'schools@codecombat.com'
|
|
|
|
# }})
|
|
|
|
# expect(sendwithus.api.send).toHaveBeenCalled()
|
|
|
|
# user = yield User.findById(@teacher.id)
|
|
|
|
# yield new Promise((resolve) -> setTimeout(resolve, 10))
|
|
|
|
# expect(user.get('enrollmentRequestSent')).toBe(true)
|
|
|
|
# done()
|