diff --git a/app/views/admin/claims/_allocations_form.html.erb b/app/views/admin/claims/_allocations_form.html.erb
index f3bb44304a..6012ef013a 100644
--- a/app/views/admin/claims/_allocations_form.html.erb
+++ b/app/views/admin/claims/_allocations_form.html.erb
@@ -1,30 +1,27 @@
-<% allocate_claim_count = @claims.where(assigned_to: nil).count > 25 ? 25 : @claims.where(assigned_to: nil).size %>
-
Allocate claims
-<%= form_with url: admin_bulk_allocate_path, method: :patch do |form| %>
- <%= form.hidden_field :allocate_claim_count, value: allocate_claim_count %>
+<%= form_with url: admin_bulk_allocate_path, method: :patch, builder: GOVUKDesignSystemFormBuilder::FormBuilder do |form| %>
-
-
- <%= form.select :allocate_to_team_member, options_for_select(DfeSignIn::User.options_for_select, params[:allocate_to_team_member]), {}, class: "govuk-select" %>
-
-
-
- <%= form.select :allocate_to_policy, options_for_select(Policies.options_for_select, params[:policy]), {include_blank: "All"}, class: "govuk-select" %>
-
+ <%= form.govuk_select(
+ :allocate_to_team_member,
+ options_for_select(DfeSignIn::User.options_for_select, params[:allocate_to_team_member]),
+ label: { text: "Team members:" }
+ ) %>
+
+ <%= form.govuk_select(
+ :allocate_to_policy,
+ options_for_select(Policies.options_for_select, params[:policy]),
+ options: { include_blank: "All" },
+ label: { text: "Policy:" }
+ ) %>
-
-
Default: 25
- <%= form.submit "Allocate claims", class: "govuk-button govuk-button--secondary", id: :allocate, disabled: allocate_claim_count.zero? %>
-
+ <%= form.govuk_select(
+ :allocate_claim_count,
+ options_for_select([5, 10, 25], params[:allocate_claim_count] || 25),
+ label: { text: "Number of claims:" }
+ ) %>
-
- <%= form.submit "Unallocate claims", class: "govuk-button govuk-button--secondary admin-filter-group__button", id: :unallocate, formaction: admin_bulk_deallocate_path %>
-
+ <%= form.submit "Allocate claims", class: "govuk-button govuk-button--secondary", id: :allocate, disabled: @claims.where(assigned_to: nil).count.zero? %>
+ <%= form.submit "Unallocate claims", class: "govuk-button govuk-button--secondary", id: :unallocate, formaction: admin_bulk_deallocate_path %>
<% end %>
diff --git a/spec/features/admin/admin_claim_allocation_spec.rb b/spec/features/admin/admin_claim_allocation_spec.rb
index 3386e7e2d3..46f7ca6261 100644
--- a/spec/features/admin/admin_claim_allocation_spec.rb
+++ b/spec/features/admin/admin_claim_allocation_spec.rb
@@ -152,6 +152,36 @@
expect(page).to have_button "Allocate claims", disabled: false
end
+ scenario "assign 5 claims to one Claim's checker" do
+ click_on "View claims"
+
+ expect(@submitted_claims.size).to eq 40
+
+ select "Frank Yee", from: "allocate_to_team_member"
+ select "All", from: "allocate_to_policy"
+ select "10", from: "allocate_claim_count"
+
+ click_on "Allocate claims"
+
+ within(".govuk-flash__notice") do
+ expect(page).to have_text I18n.t(
+ "admin.allocations.bulk_allocate.success",
+ quantity: 10,
+ pluralized_or_singular_claim: "claims",
+ allocate_to_policy: "",
+ dfe_user: frank.full_name.titleize
+ ).squeeze(" ")
+ end
+
+ @submitted_claims[0..9].each do |claim|
+ expect(claim.reload.assigned_to.full_name).to eq "Frank Yee"
+ end
+
+ @submitted_claims[10..].each do |claim|
+ expect(claim.reload.assigned_to).to be_nil
+ end
+ end
+
scenario "assign outstanding 10 claims when 25 already allocated" do
@submitted_claims.slice(0..24).each do |claim|
claim.assigned_to = @signed_in_user