From 73a5b72463afad142b6069646960185b06336dd3 Mon Sep 17 00:00:00 2001 From: Alex Kiessling <32677188+ajkiessl@users.noreply.github.com> Date: Fri, 11 Oct 2024 11:49:54 -0400 Subject: [PATCH] Set thesisStatus to APPROVED after finals submission response rejected (#851) --- .../lionpath/lionpath_export_payload.rb | 4 ++-- .../lionpath/lionpath_export_payload_spec.rb | 19 ++++++------------- 2 files changed, 8 insertions(+), 15 deletions(-) diff --git a/app/models/lionpath/lionpath_export_payload.rb b/app/models/lionpath/lionpath_export_payload.rb index 99b489b40..764fed2b2 100644 --- a/app/models/lionpath/lionpath_export_payload.rb +++ b/app/models/lionpath/lionpath_export_payload.rb @@ -37,9 +37,9 @@ def committee_approved_status? def thesis_status return 'SUBMITTED' if status_behavior.beyond_collecting_format_review_files? && - !status_behavior.beyond_waiting_for_final_submission_response? + !status_behavior.beyond_waiting_for_final_submission_response_rejected? - return 'APPROVED' if status_behavior.beyond_waiting_for_final_submission_response? + return 'APPROVED' if status_behavior.beyond_waiting_for_final_submission_response_rejected? nil end diff --git a/spec/models/lionpath/lionpath_export_payload_spec.rb b/spec/models/lionpath/lionpath_export_payload_spec.rb index 6b459dd15..501af9f83 100644 --- a/spec/models/lionpath/lionpath_export_payload_spec.rb +++ b/spec/models/lionpath/lionpath_export_payload_spec.rb @@ -23,7 +23,6 @@ before do allow(status_behavior).to receive(:beyond_collecting_format_review_files?).and_return(true) allow(status_behavior).to receive(:beyond_waiting_for_committee_review?).and_return(false) - allow(status_behavior).to receive(:beyond_waiting_for_final_submission_response?).and_return(false) allow(status_behavior).to receive(:beyond_waiting_for_committee_review_rejected?).and_return(false) allow(status_behavior).to receive(:beyond_waiting_for_final_submission_response_rejected?).and_return(false) allow(status_behavior).to receive(:waiting_for_committee_review_rejected?).and_return(false) @@ -46,7 +45,7 @@ expect(export_payload.json_payload).to eq(expected_payload) end - context 'when the submission is beyond_collecting_format_review_files but not beyond_waiting_for_final_submission_response' do + context 'when the submission is beyond_collecting_format_review_files but not beyond_waiting_for_final_submission_response_rejected' do it 'sets thesisStatus to SUBMITTED' do payload = JSON.parse(export_payload.json_payload) expect(payload["PE_SR199_ETD_REQ"]["thesisStatus"]).to eq("SUBMITTED") @@ -58,17 +57,6 @@ end end - context 'when the submission is beyond_waiting_for_final_submission_response' do - before do - allow(status_behavior).to receive(:beyond_waiting_for_final_submission_response?).and_return(true) - end - - it 'sets thesisStatus to APPROVED' do - payload = JSON.parse(export_payload.json_payload) - expect(payload["PE_SR199_ETD_REQ"]["thesisStatus"]).to eq("APPROVED") - end - end - context 'when the submission is beyond_waiting_for_committee_review_rejected' do before do allow(status_behavior).to receive(:beyond_waiting_for_committee_review_rejected?).and_return(true) @@ -136,6 +124,11 @@ payload = JSON.parse(export_payload.json_payload) expect(payload["PE_SR199_ETD_REQ"]["grdtnFlg"]).to eq('Y') end + + it 'sets thesisStatus to APPROVED' do + payload = JSON.parse(export_payload.json_payload) + expect(payload["PE_SR199_ETD_REQ"]["thesisStatus"]).to eq("APPROVED") + end end context 'when access_level is open_access' do