Show message for headings without winner investments
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
<h4 id="<%= heading.name.parameterize %>">
|
||||
<%= heading.name %>
|
||||
</h4>
|
||||
<% if winner_investments(heading).any? %>
|
||||
<div class="row" data-equalizer-on="medium" data-equalizer>
|
||||
<% winner_investments(heading).each do |investment| %>
|
||||
<div class="small-12 medium-6 large-4 column end margin-bottom">
|
||||
@@ -30,4 +31,9 @@
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="callout primary clear">
|
||||
<%= t("budgets.executions.no_winner_investments") %>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
@@ -179,6 +179,7 @@ en:
|
||||
page_title: "%{budget} - Milestones"
|
||||
heading: "Participatory budget Milestones"
|
||||
heading_selection_title: "By district"
|
||||
no_winner_investments: "No winner investments for this heading"
|
||||
filters:
|
||||
label: "Project's current state"
|
||||
all: "All"
|
||||
|
||||
@@ -179,6 +179,7 @@ es:
|
||||
page_title: "%{budget} - Seguimiento de proyectos"
|
||||
heading: "Seguimiento de proyectos"
|
||||
heading_selection_title: "Ámbito de actuación"
|
||||
no_winner_investments: "No hay proyectos de gasto ganadores para esta partida"
|
||||
filters:
|
||||
label: "Estado actual del proyecto"
|
||||
all: "Todos"
|
||||
|
||||
@@ -27,6 +27,23 @@ feature 'Executions' do
|
||||
expect(page).not_to have_content(investment4.title)
|
||||
end
|
||||
|
||||
scenario 'render a message for headings without winner investments' do
|
||||
empty_group = create(:budget_group, budget: budget)
|
||||
empty_heading = create(:budget_heading, group: empty_group, price: 1000)
|
||||
|
||||
visit budget_path(budget)
|
||||
click_link 'See results'
|
||||
|
||||
expect(page).to have_content(heading.name)
|
||||
expect(page).to have_content(empty_heading.name)
|
||||
|
||||
click_link 'Milestones'
|
||||
click_link "#{empty_heading.name}"
|
||||
|
||||
expect(page).to have_content('No winner investments for this heading')
|
||||
end
|
||||
|
||||
|
||||
context 'Images' do
|
||||
scenario 'renders milestone image if available' do
|
||||
milestone1 = create(:budget_investment_milestone, investment: investment1)
|
||||
|
||||
Reference in New Issue
Block a user