Skip to content

Commit 8383ae9

Browse files
committed
Transition to "in_review" after levy calculation
We're now calculating the levy before we show the user the screen to review the submission. Therefor we need to transition it to "in_review", rather than completed, otherwise the user never gets to confirm their submission is correct.
1 parent b275389 commit 8383ae9

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

app/controllers/v1/submissions_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def create
2828
def update
2929
submission = Submission.find(params[:id])
3030
submission.levy = update_submission_params[:levy] * 100
31-
submission.aasm.current_state = 'completed' if update_submission_params[:levy]
31+
submission.ready_for_review!
3232

3333
if submission.save
3434
head :no_content

spec/requests/v1/submissions_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
submission.reload
122122

123123
expect(submission.levy).to eql 4250
124-
expect(submission).to be_completed
124+
expect(submission).to be_in_review
125125
end
126126
end
127127

0 commit comments

Comments
 (0)