Disable calculating winners during balloting

Calculating winners before the balloting is over is useless (results
aren't published at that point) and can lead to the wrong results since
users are still voting and results might change.

And we were showing the button to calculate winners even when a budget
had finished. However, in this case the action to calculate winners did
nothing, which resulted in administrators seeing nothing happened after
pressing the button.
This commit is contained in:
Javi Martín
2021-08-30 15:11:02 +02:00
parent 2b709f1a36
commit 0a14337580
11 changed files with 81 additions and 36 deletions

View File

@@ -515,9 +515,8 @@ describe "Admin budget investments", :admin do
click_button "Filter"
expect(page).not_to have_button "Calculate Winner Investments"
expect(page).to have_content 'The budget has to stay on phase "Balloting projects", '\
'"Reviewing Ballots" or "Finished budget" in order '\
"to calculate winners projects"
expect(page).to have_content 'The budget has to stay on phase "Reviewing voting" '\
"in order to calculate winners projects"
visit admin_budget_path(budget)