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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user