Add budget investment factory to fix failing scenario

Changes introduced in commits 41f66fa and dc87b75 will render the
'See results' button under `admin/budget_investments` only if a
finished budget has winner investments associated with it
This commit is contained in:
Angel Perez
2018-07-09 07:59:20 -04:00
committed by Marko Lovic
parent 15a07ad4eb
commit c240c57171

View File

@@ -541,21 +541,18 @@ feature 'Admin budget investments' do
end
scenario "See results button appears when budget status is finished" do
finished_budget = create(:budget, :finished)
create(:budget_investment, :winner, budget: finished_budget, title: "Winner project")
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