Do not display voting button for unselected investments
This commit is contained in:
@@ -216,7 +216,7 @@ class Budget
|
|||||||
end
|
end
|
||||||
|
|
||||||
def should_show_ballots?
|
def should_show_ballots?
|
||||||
budget.balloting?
|
budget.balloting? && selected?
|
||||||
end
|
end
|
||||||
|
|
||||||
def should_show_price?
|
def should_show_price?
|
||||||
|
|||||||
@@ -652,6 +652,24 @@ feature 'Budget Investments' do
|
|||||||
expect(page).to have_current_path(expected_path)
|
expect(page).to have_current_path(expected_path)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
scenario "Do not display vote button for unselected investments in index" do
|
||||||
|
investment = create(:budget_investment, :unselected, heading: heading)
|
||||||
|
|
||||||
|
visit budget_investments_path(budget_id: budget.id, heading_id: heading.id, filter: "unselected")
|
||||||
|
|
||||||
|
expect(page).to have_content investment.title
|
||||||
|
expect(page).to_not have_link("Vote")
|
||||||
|
end
|
||||||
|
|
||||||
|
scenario "Do not display vote button for unselected investments in show" do
|
||||||
|
investment = create(:budget_investment, :unselected, heading: heading)
|
||||||
|
|
||||||
|
visit budget_investment_path(budget, investment)
|
||||||
|
|
||||||
|
expect(page).to have_content investment.title
|
||||||
|
expect(page).to_not have_link("Vote")
|
||||||
|
end
|
||||||
|
|
||||||
scenario "Reclassification" do
|
scenario "Reclassification" do
|
||||||
user = create(:user, :level_two)
|
user = create(:user, :level_two)
|
||||||
investment = create(:budget_investment, :selected, heading: heading)
|
investment = create(:budget_investment, :selected, heading: heading)
|
||||||
|
|||||||
Reference in New Issue
Block a user