Skip to content

Commit

Permalink
Merge pull request #3376 from DFE-Digital/CAPT-1893/amending-claims-a…
Browse files Browse the repository at this point in the history
…dding-slc-plan-1

Fix assigning SLC plan 1
  • Loading branch information
rjlynch authored Nov 8, 2024
2 parents 767c3d1 + 7b5d867 commit fd8063b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 0 additions & 1 deletion app/models/claim.rb
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ class Claim < ApplicationRecord

validates :has_student_loan, on: [:"student-loan"], inclusion: {in: [true, false]}, allow_nil: true
validates :student_loan_plan, inclusion: {in: STUDENT_LOAN_PLAN_OPTIONS}, allow_nil: true
validates :student_loan_plan, on: [:amendment], presence: {message: "Enter a valid student loan plan"}

validates :bank_sort_code, on: [:amendment], presence: {message: "Enter a sort code"}
validates :bank_account_number, on: [:amendment], presence: {message: "Enter an account number"}
Expand Down
7 changes: 6 additions & 1 deletion app/views/admin/amendments/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,12 @@
</div>
<div class="govuk-grid-column-two-thirds">
<div class="govuk-form-group">
<%= claim_form.select :student_loan_plan, Claim::STUDENT_LOAN_PLAN_OPTIONS.map { |option| [option.humanize, option] }, {}, { class: "govuk-select" } %>
<%= claim_form.select(
:student_loan_plan,
Claim::STUDENT_LOAN_PLAN_OPTIONS.map { |option| [option.humanize, option] },
{ include_blank: true },
{ class: "govuk-select" }
) %>
</div>
</div>
</div>
Expand Down
1 change: 0 additions & 1 deletion spec/models/claim_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@
expect(claim).not_to be_valid(:amendment)
expect(claim.errors.map(&:message)).to contain_exactly(
"Enter your teacher reference number",
"Enter a valid student loan plan",
"Enter a sort code",
"Enter an account number"
)
Expand Down

0 comments on commit fd8063b

Please sign in to comment.