Merge pull request #2766 from consul/budget-winner-project

Budgets investment show messages
This commit is contained in:
Alberto
2018-07-13 19:39:46 +02:00
committed by GitHub
5 changed files with 47 additions and 2 deletions

View File

@@ -141,6 +141,14 @@
<div class="callout warning"> <div class="callout warning">
<%= t("budgets.investments.show.project_unfeasible_html") %> <%= t("budgets.investments.show.project_unfeasible_html") %>
</div> </div>
<% elsif investment.winner? %>
<div class="callout success">
<strong><%= t("budgets.investments.show.project_winner") %></strong>
</div>
<% elsif investment.selected? %>
<div class="callout success">
<%= t("budgets.investments.show.project_selected_html") %>
</div>
<% elsif !investment.selected? %> <% elsif !investment.selected? %>
<div class="callout warning"> <div class="callout warning">
<%= t("budgets.investments.show.project_not_selected_html") %> <%= t("budgets.investments.show.project_not_selected_html") %>

View File

@@ -29,8 +29,6 @@ en:
title: Title title: Title
description: Description description: Description
target_url: Link target_url: Link
style: Style
image: Image
post_started_at: Post started at post_started_at: Post started at
post_ended_at: Post ended at post_ended_at: Post ended at
sections_label: Sections where it will appear sections_label: Sections where it will appear

View File

@@ -127,6 +127,8 @@ en:
milestone_status_changed: Investment status changed to milestone_status_changed: Investment status changed to
author: Author author: Author
project_unfeasible_html: 'This investment project <strong>has been marked as not feasible</strong> and will not go to balloting phase.' project_unfeasible_html: 'This investment project <strong>has been marked as not feasible</strong> and will not go to balloting phase.'
project_selected_html: 'This investment project <strong>has been selected</strong> for balloting phase.'
project_winner: 'Winning investment project'
project_not_selected_html: 'This investment project <strong>has not been selected</strong> for balloting phase.' project_not_selected_html: 'This investment project <strong>has not been selected</strong> for balloting phase.'
wrong_price_format: Only integer numbers wrong_price_format: Only integer numbers
investment: investment:

View File

@@ -127,6 +127,8 @@ es:
milestone_status_changed: El proyecto ha cambiado al estado milestone_status_changed: El proyecto ha cambiado al estado
author: Autor author: Autor
project_unfeasible_html: 'Este proyecto de inversión <strong>ha sido marcado como inviable</strong> y no pasará a la fase de votación.' project_unfeasible_html: 'Este proyecto de inversión <strong>ha sido marcado como inviable</strong> y no pasará a la fase de votación.'
project_selected_html: 'Este proyecto de gasto <strong>ha sido seleccionado</strong> para la fase de votación.'
project_winner: 'Proyecto de gasto ganador'
project_not_selected_html: 'Este proyecto de inversión <strong>no ha sido seleccionado</strong> para la fase de votación.' project_not_selected_html: 'Este proyecto de inversión <strong>no ha sido seleccionado</strong> para la fase de votación.'
wrong_price_format: Solo puede incluir caracteres numéricos wrong_price_format: Solo puede incluir caracteres numéricos
investment: investment:

View File

@@ -956,6 +956,41 @@ feature 'Budget Investments' do
expect(page).to have_content("This investment project has been marked as not feasible and will not go to balloting phase") expect(page).to have_content("This investment project has been marked as not feasible and will not go to balloting phase")
end end
scenario "Show (selected budget investment)" do
user = create(:user)
login_as(user)
investment = create(:budget_investment,
:feasible,
:finished,
:selected,
budget: budget,
group: group,
heading: heading)
visit budget_investment_path(budget_id: budget.id, id: investment.id)
expect(page).to have_content("This investment project has been selected for balloting phase")
end
scenario "Show (winner budget investment)" do
user = create(:user)
login_as(user)
investment = create(:budget_investment,
:feasible,
:finished,
:selected,
:winner,
budget: budget,
group: group,
heading: heading)
visit budget_investment_path(budget_id: budget.id, id: investment.id)
expect(page).to have_content("Winning investment project")
end
scenario "Show (not selected budget investment)" do scenario "Show (not selected budget investment)" do
user = create(:user) user = create(:user)
login_as(user) login_as(user)