Merge pull request #1294 from sharelatex/mm-exportstatus-fields

F1000 export fixes

GitOrigin-RevId: 8f9a149cded8f204949750fc2788bc02223b84af
This commit is contained in:
Chrystal Maria Griffiths 2018-12-19 10:24:01 +00:00 committed by sharelatex
parent bfeefe8406
commit 2b556df43c
2 changed files with 23 additions and 2 deletions

View file

@ -48,6 +48,10 @@ module.exports =
status_summary: parsed_export.status_summary,
status_detail: parsed_export.status_detail,
partner_submission_id: parsed_export.partner_submission_id,
v2_user_email: parsed_export.v2_user_email,
v2_user_first_name: parsed_export.v2_user_first_name,
v2_user_last_name: parsed_export.v2_user_last_name,
title: parsed_export.title,
token: parsed_export.token
}
res.send export_json: json

View file

@ -85,11 +85,28 @@ describe 'ExportsController', ->
it 'should ask the handler to return the status of an export', (done) ->
@handler.fetchExport = sinon.stub().yields(
null,
"{\"id\":897, \"status_summary\":\"completed\"}")
"{
\"id\":897,
\"status_summary\":\"completed\",
\"status_detail\":\"all done\",
\"partner_submission_id\":\"abc123\",
\"v2_user_email\":\"la@tex.com\",
\"v2_user_first_name\":\"Arthur\",
\"v2_user_last_name\":\"Author\",
\"title\":\"my project\",
\"token\":\"token\"
}")
@req.params = {project_id: project_id, export_id: 897}
@controller.exportStatus @req, send:(body) =>
expect(body).to.deep.equal {export_json: {
status_summary: 'completed', status_detail: undefined, partner_submission_id: undefined, token: undefined
status_summary: 'completed',
status_detail: "all done",
partner_submission_id: "abc123",
v2_user_email: "la@tex.com",
v2_user_first_name: "Arthur",
v2_user_last_name: "Author",
title: "my project",
token: "token"
}}
done()