Merge pull request #1525 from consul/ballot-reviewing

Display correct heading name when reviewing ballot
This commit is contained in:
Raimond Garcia
2017-05-08 13:50:18 +02:00
committed by GitHub
2 changed files with 4 additions and 2 deletions

View File

@@ -24,7 +24,7 @@
<div id="<%= dom_id(group) %>"
class="small-12 medium-6 column">
<h3 class="subtitle">
<%= group.name %> - <%= group.headings.first.name %>
<%= group.name %> - <%= @ballot.heading_for_group(group).name %>
</h3>
<% if @ballot.has_lines_in_group?(group) %>
<h4 class="amount-spent text-right">

View File

@@ -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)