diff --git a/app/views/budgets/ballot/_ballot.html.erb b/app/views/budgets/ballot/_ballot.html.erb
index 1e805322e..aa37828b2 100644
--- a/app/views/budgets/ballot/_ballot.html.erb
+++ b/app/views/budgets/ballot/_ballot.html.erb
@@ -24,7 +24,7 @@
- <%= group.name %> - <%= group.headings.first.name %>
+ <%= group.name %> - <%= @ballot.heading_for_group(group).name %>
<% if @ballot.has_lines_in_group?(group) %>
diff --git a/spec/features/budgets/ballots_spec.rb b/spec/features/budgets/ballots_spec.rb
index e932b577f..446fb3984 100644
--- a/spec/features/budgets/ballots_spec.rb
+++ b/spec/features/budgets/ballots_spec.rb
@@ -313,12 +313,14 @@ feature 'Ballots' do
expect(current_path).to eq(budget_investments_path(budget))
end
- scenario 'Displaying the correct count & amount' do
+ scenario 'Displaying the correct group, heading, count & amount' do
group1 = create(:budget_group, budget: budget)
group2 = create(:budget_group, budget: budget)
+ create(:budget_heading, name: "District A", group: group1, price: 100)
heading1 = create(:budget_heading, name: "District 1", group: group1, price: 100)
heading2 = create(:budget_heading, name: "District 2", group: group2, price: 50)
+ create(:budget_heading, name: "District Z", group: group1, price: 100)
investment1 = create(:budget_investment, :selected, price: 10, heading: heading1)
investment2 = create(:budget_investment, :selected, price: 10, heading: heading1)