Show should display supports

This commit is contained in:
rgarcia
2017-03-24 13:49:56 +01:00
parent cfac1ebcc7
commit 4da66e3f51
2 changed files with 16 additions and 4 deletions

View File

@@ -225,7 +225,7 @@ class Budget
def should_show_aside?
(budget.selecting? && !unfeasible?) ||
(budget.balloting? && feasible?) ||
(budget.valuating? && feasible?)
(budget.valuating? && !unfeasible?)
end
def should_show_votes?

View File

@@ -405,7 +405,7 @@ feature 'Budget Investments' do
budget.update(phase: "valuating")
end
scenario "Sidebar in show should display supports text and supports" do
scenario "Sidebar in show should display support text and count" do
investment = create(:budget_investment, :selected, budget: budget)
create(:vote, votable: investment)
@@ -417,8 +417,8 @@ feature 'Budget Investments' do
end
end
scenario "Index should display supports" do
investment = create(:budget_investment, :selected, budget: budget, heading: heading)
scenario "Index should display support count" do
investment = create(:budget_investment, budget: budget, heading: heading)
create(:vote, votable: investment)
visit budget_investments_path(budget, heading_id: heading.id)
@@ -428,6 +428,18 @@ feature 'Budget Investments' do
end
end
scenario "Show should display support text and count" do
investment = create(:budget_investment, budget: budget, heading: heading)
create(:vote, votable: investment)
visit budget_investment_path(budget, investment)
within("#budget_investment_#{investment.id}") do
expect(page).to have_content "Supports"
expect(page).to have_content "1 support"
end
end
end
context "Balloting Phase" do