send fixed confirmed date to v1 for affiliations

This commit is contained in:
hugh-obrien
2018-08-16 13:50:34 +01:00
parent 55597b9279
commit 96ffeef73d
4 changed files with 6 additions and 6 deletions
@@ -74,7 +74,7 @@ describe "InstitutionsAPI", ->
university: { id: 1 }
role: 'Prof'
department: 'Math'
confirmed: true
confirmedAt: new Date()
@InstitutionsAPI.addAffiliation @stubbedUser._id, @newEmail, affiliationOptions, (err)=>
should.not.exist(err)
@request.calledOnce.should.equal true
@@ -89,7 +89,7 @@ describe "InstitutionsAPI", ->
body.university.should.equal affiliationOptions.university
body.department.should.equal affiliationOptions.department
body.role.should.equal affiliationOptions.role
body.confirmed.should.equal affiliationOptions.confirmed
body.confirmedAt.should.equal affiliationOptions.confirmedAt
done()
it 'handle error', (done)->
@@ -241,7 +241,7 @@ describe "UserUpdater", ->
@UserUpdater.confirmEmail @stubbedUser._id, @newEmail, (err)=>
should.not.exist(err)
@addAffiliation.calledOnce.should.equal true
sinon.assert.calledWith(@addAffiliation, @stubbedUser._id, @newEmail, { confirmed: true } )
sinon.assert.calledWith(@addAffiliation, @stubbedUser._id, @newEmail, { confirmedAt: new Date() } )
done()
it 'handle error', (done)->