Update calculate winners button on budgets form

This commit is contained in:
decabeza
2019-02-04 14:22:04 +01:00
parent ad1c8876ed
commit 5974b7ee84
3 changed files with 41 additions and 12 deletions

View File

@@ -359,20 +359,30 @@ feature 'Admin budget investments' do
end
scenario "Disable 'Calculate winner' button if incorrect phase" do
budget.update(phase: 'reviewing_ballots')
budget.update(phase: "reviewing_ballots")
visit admin_budget_budget_investments_path(budget)
click_link 'Winners'
click_link "Winners"
expect(page).to have_link "Calculate Winner Investments"
budget.update(phase: 'accepting')
visit edit_admin_budget_path(budget)
expect(page).to have_link "Calculate Winner Investments"
budget.update(phase: "accepting")
visit admin_budget_budget_investments_path(budget)
click_link 'Winners'
click_link "Winners"
expect(page).not_to have_link "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"
visit edit_admin_budget_path(budget)
expect(page).not_to have_link "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'
end
scenario "Filtering by minimum number of votes", :js do