diff --git a/app/views/story_shares/_sector_index.html.erb b/app/views/story_shares/_sector_index.html.erb index fb5741bc2b..ac50eb4c9f 100644 --- a/app/views/story_shares/_sector_index.html.erb +++ b/app/views/story_shares/_sector_index.html.erb @@ -3,7 +3,9 @@

- <%= params[:sector_names_all].to_s.titleize %> + <%# Sector names carry intentional casing ("LGBTQIA+", "Self-Care/Personal + Growth"); render them as stored rather than running .titleize. %> + <%= @sector_names_all.to_sentence %>

<% if @stories_by_sector.first.second.any? %> diff --git a/app/views/workshops/_dropdown_filter.html.erb b/app/views/workshops/_dropdown_filter.html.erb index fa4fe75ff8..a6685dd8f1 100644 --- a/app/views/workshops/_dropdown_filter.html.erb +++ b/app/views/workshops/_dropdown_filter.html.erb @@ -40,8 +40,10 @@ params.dig(param_name, item.id.to_s).to_s == item.id.to_s, id: "#{param_name}_#{item.id}", class: "category-checkbox" %> + <%# Render the label as stored — sector names carry intentional casing + (e.g. "LGBTQIA+", "Child Abuse/Neglect") that .humanize would flatten. %> <%= label_tag "#{param_name}_#{item.id}", - item.public_send(label_method).humanize, + item.public_send(label_method), class: "text-sm text-gray-700" %> <% end %> diff --git a/spec/requests/workshops_spec.rb b/spec/requests/workshops_spec.rb index 655a429b1f..ad94252c32 100644 --- a/spec/requests/workshops_spec.rb +++ b/spec/requests/workshops_spec.rb @@ -40,6 +40,21 @@ end end + # --- SECTOR FILTER LABELS -------------------------------------------------- + describe "sector filter dropdown labels" do + let(:admin) { create(:user, :admin) } + let!(:sector) { create(:sector, :published, name: "LGBTQIA+") } + + before { sign_in admin } + + it "renders sector names with their canonical casing, not sentence case" do + get workshops_url + + expect(response.body).to include("LGBTQIA+") + expect(response.body).not_to include("Lgbtqia+") + end + end + # --- DESTROY --------------------------------------------------------------- describe "DELETE /destroy" do let(:user) { create(:user) }