Show project winner label only if budget is finished
This commit is contained in:
@@ -150,7 +150,7 @@
|
||||
<div class="callout warning">
|
||||
<%= t("budgets.investments.show.project_unfeasible_html") %>
|
||||
</div>
|
||||
<% elsif investment.winner? %>
|
||||
<% elsif investment.winner? && @budget.finished? %>
|
||||
<div class="callout success">
|
||||
<strong><%= t("budgets.investments.show.project_winner") %></strong>
|
||||
</div>
|
||||
|
||||
@@ -1073,7 +1073,8 @@ feature 'Budget Investments' do
|
||||
expect(page).to have_content("This investment project has been selected for balloting phase")
|
||||
end
|
||||
|
||||
scenario "Show (winner budget investment)" do
|
||||
scenario "Show (winner budget investment) only if budget is finished" do
|
||||
budget.update(phase: "balloting")
|
||||
user = create(:user)
|
||||
login_as(user)
|
||||
|
||||
@@ -1088,6 +1089,12 @@ feature 'Budget Investments' do
|
||||
|
||||
visit budget_investment_path(budget_id: budget.id, id: investment.id)
|
||||
|
||||
expect(page).not_to have_content("Winning investment project")
|
||||
|
||||
budget.update(phase: "finished")
|
||||
|
||||
visit budget_investment_path(budget_id: budget.id, id: investment.id)
|
||||
|
||||
expect(page).to have_content("Winning investment project")
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user