Fix investment creation for single budget usage

Budget Investment factory creates a secondary budget as a collateral
effect because it has a Heading factory that has a Group factory that
creates a Budget.

This was resulting in problems due to having two "active" Budgets created
and `current_budget` method not choosing the one that we expected
This commit is contained in:
Bertocq
2018-03-12 23:05:26 +01:00
parent 8fd6f8f1d6
commit c0986c7bfb
3 changed files with 11 additions and 10 deletions

View File

@@ -5,7 +5,9 @@ feature 'Internal valuation comments on Budget::Investments' do
let(:valuator_user) { create(:valuator).user }
let(:admin_user) { create(:administrator).user }
let(:budget) { create(:budget, :valuating) }
let(:investment) { create(:budget_investment, budget: budget) }
let(:group) { create(:budget_group, budget: budget) }
let(:heading) { create(:budget_heading, group: group) }
let(:investment) { create(:budget_investment, budget: budget, group: group, heading: heading) }
background do
Setting['feature.budgets'] = true