From 39ed526b89bd46a8dc3bee28a58763f68a874333 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baza=CC=81n?= Date: Mon, 8 May 2017 13:22:53 +0200 Subject: [PATCH] displays correct heading name when reviewing ballot --- app/views/budgets/ballot/_ballot.html.erb | 2 +- spec/features/budgets/ballots_spec.rb | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/views/budgets/ballot/_ballot.html.erb b/app/views/budgets/ballot/_ballot.html.erb index 0bf49097f..bfd9bc668 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)