Add unfinished trait to investment factories
Now the code is symmetrical since we also use `finished`.
This commit is contained in:
@@ -114,6 +114,10 @@ FactoryBot.define do
|
||||
valuation_finished { true }
|
||||
end
|
||||
|
||||
trait :unfinished do
|
||||
valuation_finished { false }
|
||||
end
|
||||
|
||||
trait :selected do
|
||||
selected { true }
|
||||
feasibility { "feasible" }
|
||||
|
||||
@@ -346,7 +346,7 @@ describe "Admin budget investments" do
|
||||
valuator = create(:valuator, user: user)
|
||||
create(:budget_investment,
|
||||
:with_administrator,
|
||||
valuation_finished: false,
|
||||
:unfinished,
|
||||
title: "Investment without valuation",
|
||||
budget: budget,
|
||||
valuators: [valuator])
|
||||
|
||||
@@ -1263,7 +1263,7 @@ describe "Budget Investments" do
|
||||
|
||||
investment = create(:budget_investment,
|
||||
:unfeasible,
|
||||
valuation_finished: false,
|
||||
:unfinished,
|
||||
budget: budget,
|
||||
group: group,
|
||||
heading: heading,
|
||||
|
||||
@@ -1228,10 +1228,7 @@ describe Budget::Investment do
|
||||
let(:params) { { advanced_filters: ["under_valuation"], budget_id: budget.id } }
|
||||
it "returns only investment under valuation" do
|
||||
valuator1 = create(:valuator)
|
||||
investment1 = create(:budget_investment,
|
||||
:with_administrator,
|
||||
valuation_finished: false,
|
||||
budget: budget)
|
||||
investment1 = create(:budget_investment, :with_administrator, :unfinished, budget: budget)
|
||||
investment1.valuators << valuator1
|
||||
create(:budget_investment, :with_administrator, budget: budget)
|
||||
create(:budget_investment, budget: budget)
|
||||
|
||||
Reference in New Issue
Block a user