Adds specs for loading first heading

This commit is contained in:
rgarcia
2017-07-13 12:37:14 +02:00
parent ffb80d8c51
commit c0d3ccaf46

View File

@@ -46,6 +46,18 @@ feature 'Results' do
end
end
scenario "Load first budget heading if not specified" do
other_heading = create(:budget_heading, group: group)
other_investment = create(:budget_investment, :winner, heading: other_heading)
visit budget_results_path(budget)
within("#budget-investments-compatible") do
expect(page).to have_content investment1.title
expect(page).to_not have_content other_investment.title
end
end
scenario "If budget is in a phase different from finished results can't be accessed" do
budget.update phase: (Budget::PHASES - ["finished"]).sample
visit budget_path(budget)