Merge pull request #3603 from consul/admin_stats_before_voting_phase

Avoid error when accessing final voting stats before the balloting phase
This commit is contained in:
Julian Nicolas Herrero
2019-06-11 14:34:42 +02:00
committed by GitHub
6 changed files with 31 additions and 2 deletions

View File

@@ -189,6 +189,21 @@ describe "Stats" do
expect(page).to have_content 0
end
end
scenario "hide final voting link" do
visit admin_stats_path
click_link "Participatory Budgets"
within("#budget_#{@budget.id}") do
expect(page).not_to have_link "Final voting"
end
end
scenario "show message when accessing final voting stats" do
visit budget_balloting_admin_stats_path(budget_id: @budget.id)
expect(page).to have_content "There isn't any data to show before the balloting phase."
end
end
context "Balloting phase" do