diff --git a/app/views/people/show.html.erb b/app/views/people/show.html.erb index fbee7c1a9..4f7e88542 100644 --- a/app/views/people/show.html.erb +++ b/app/views/people/show.html.erb @@ -132,7 +132,7 @@

Primary sector

- <% if primary_sector_items.any? || other_service_areas.any? %> + <% if primary_sector_items.any? %>
<% primary_sector_items.each do |si| %> <%= render "sectors/tagging_label", @@ -140,7 +140,6 @@ display_leader: true, is_leader: si.is_leader %> <% end %> - <%= render "people/other_responses", responses: other_service_areas %>
<% else %>

None selected.

@@ -148,7 +147,7 @@

Additional sectors

- <% if additional_sector_items.any? %> + <% if additional_sector_items.any? || other_service_areas.any? %>
<% additional_sector_items.each do |si| %> <%= render "sectors/tagging_label", @@ -156,6 +155,7 @@ display_leader: true, is_leader: si.is_leader %> <% end %> + <%= render "people/other_responses", responses: other_service_areas %>
<% else %>

None selected.

diff --git a/db/seeds/dev/events_management.rb b/db/seeds/dev/events_management.rb index 48ab82884..453edc56c 100644 --- a/db/seeds/dev/events_management.rb +++ b/db/seeds/dev/events_management.rb @@ -648,7 +648,10 @@ # answered on a submission, and only enriches people who have a submission (so the # "registered but didn't fill the form" scenarios stay answer-free). age_range_categories = Category.age_ranges.published.order(:position, :name).to_a -service_area_sectors = Sector.published.order(:name).to_a +# Exclude the catch-all "Other" sector: it's the free-text fallback registrants +# type into (surfaced via Person#other_service_area_responses), not a selectable +# service area. Seeding it as a sector tag would list "Other" as a real service area. +service_area_sectors = Sector.published.excluding_other.order(:name).to_a record_professional_answers = ->(submission, i) do person = submission.person diff --git a/spec/requests/people_other_responses_spec.rb b/spec/requests/people_other_responses_spec.rb index be5309161..ca58916f6 100644 --- a/spec/requests/people_other_responses_spec.rb +++ b/spec/requests/people_other_responses_spec.rb @@ -14,13 +14,16 @@ def answer(identifier, value) before { sign_in admin } describe "profile page" do - it "shows the Other service area beside the sector tags" do + it "shows the Other service area as an additional sector" do person.update!(profile_show_sectors: true) answer("primary_service_area", "Other: Equine therapy") get person_path(person) expect(response.body).to include("Equine therapy") + # The Other chip sits in the "Additional sectors" column, not "Primary sector". + additional_section = response.body.split("Additional sectors").last + expect(additional_section).to include("Equine therapy") end end