Adds logic to show 'see results' button only for finished budgets

This commit is contained in:
María Checa
2018-06-29 17:27:36 +02:00
committed by Marko Lovic
parent db44dd1226
commit 15a07ad4eb
2 changed files with 25 additions and 5 deletions

View File

@@ -540,6 +540,24 @@ feature 'Admin budget investments' do
end
scenario "See results button appears when budget status is finished" do
finished_budget = create(:budget, :finished)
visit admin_budget_budget_investments_path(budget_id: finished_budget.id)
expect(page).to have_content "See results"
end
scenario "See results button does not appear for unfinished budgets" do
not_finished_budget = create(:budget, :valuating)
visit admin_budget_budget_investments_path(budget_id: not_finished_budget.id)
expect(page).not_to have_content "See results"
end
end
context 'Search' do