|
@@ -74,6 +74,7 @@ describe "InstitutionsAPI", ->
|
|
|
university: { id: 1 }
|
|
university: { id: 1 }
|
|
|
role: 'Prof'
|
|
role: 'Prof'
|
|
|
department: 'Math'
|
|
department: 'Math'
|
|
|
|
|
+ confirmedAt: new Date()
|
|
|
@InstitutionsAPI.addAffiliation @stubbedUser._id, @newEmail, affiliationOptions, (err)=>
|
|
@InstitutionsAPI.addAffiliation @stubbedUser._id, @newEmail, affiliationOptions, (err)=>
|
|
|
should.not.exist(err)
|
|
should.not.exist(err)
|
|
|
@request.calledOnce.should.equal true
|
|
@request.calledOnce.should.equal true
|
|
@@ -83,11 +84,12 @@ describe "InstitutionsAPI", ->
|
|
|
requestOptions.method.should.equal 'POST'
|
|
requestOptions.method.should.equal 'POST'
|
|
|
|
|
|
|
|
body = requestOptions.body
|
|
body = requestOptions.body
|
|
|
- Object.keys(body).length.should.equal 4
|
|
|
|
|
|
|
+ Object.keys(body).length.should.equal 5
|
|
|
body.email.should.equal @newEmail
|
|
body.email.should.equal @newEmail
|
|
|
body.university.should.equal affiliationOptions.university
|
|
body.university.should.equal affiliationOptions.university
|
|
|
body.department.should.equal affiliationOptions.department
|
|
body.department.should.equal affiliationOptions.department
|
|
|
body.role.should.equal affiliationOptions.role
|
|
body.role.should.equal affiliationOptions.role
|
|
|
|
|
+ body.confirmedAt.should.equal affiliationOptions.confirmedAt
|
|
|
done()
|
|
done()
|
|
|
|
|
|
|
|
it 'handle error', (done)->
|
|
it 'handle error', (done)->
|