Show should display supports
This commit is contained in:
@@ -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?
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user