Added test to bugets/index to ensure the correcto showing of the investment links over ths changes of the buget's phase
This commit is contained in:
@@ -77,6 +77,46 @@ feature 'Budgets' do
|
||||
expect(page).not_to have_css('div#map')
|
||||
end
|
||||
end
|
||||
|
||||
scenario 'Show investment links only on balloting or later' do
|
||||
|
||||
budget = create(:budget)
|
||||
group = create(:budget_group, budget: budget)
|
||||
heading = create(:budget_heading, group: group)
|
||||
|
||||
['reviewing_ballots', 'finished'].each do |phase|
|
||||
budget.update(phase: phase)
|
||||
|
||||
visit budgets_path
|
||||
|
||||
expect(page).to have_content(I18n.t("budgets.index.investment_proyects"))
|
||||
expect(page).to have_content(I18n.t("budgets.index.unfeasible_investment_proyects"))
|
||||
expect(page).to have_content(I18n.t("budgets.index.not_selected_investment_proyects"))
|
||||
end
|
||||
end
|
||||
|
||||
scenario 'Not show investment links earlier of balloting ' do
|
||||
|
||||
budget = create(:budget)
|
||||
group = create(:budget_group, budget: budget)
|
||||
heading = create(:budget_heading, group: group)
|
||||
phases_without_links = ['drafting','informing']
|
||||
allowed_phase_list = ['reviewing_ballots', 'finished']
|
||||
not_allowed_phase_list = Budget::Phase::PHASE_KINDS -
|
||||
phases_without_links -
|
||||
allowed_phase_list
|
||||
|
||||
not_allowed_phase_list.each do |phase|
|
||||
budget.update(phase: phase)
|
||||
|
||||
visit budgets_path
|
||||
|
||||
expect(page).not_to have_content(I18n.t("budgets.index.investment_proyects"))
|
||||
expect(page).to have_content(I18n.t("budgets.index.unfeasible_investment_proyects"))
|
||||
expect(page).not_to have_content(I18n.t("budgets.index.not_selected_investment_proyects"))
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
scenario 'Index shows only published phases' do
|
||||
|
||||
Reference in New Issue
Block a user