Skip to content

Commit

Permalink
Set thesisStatus to APPROVED after finals submission response rejected (
Browse files Browse the repository at this point in the history
  • Loading branch information
ajkiessl authored Oct 11, 2024
1 parent 4d883ac commit 73a5b72
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
4 changes: 2 additions & 2 deletions app/models/lionpath/lionpath_export_payload.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 6 additions & 13 deletions spec/models/lionpath/lionpath_export_payload_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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")
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 73a5b72

Please sign in to comment.