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 }
|
valuation_finished { true }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
trait :unfinished do
|
||||||
|
valuation_finished { false }
|
||||||
|
end
|
||||||
|
|
||||||
trait :selected do
|
trait :selected do
|
||||||
selected { true }
|
selected { true }
|
||||||
feasibility { "feasible" }
|
feasibility { "feasible" }
|
||||||
|
|||||||
@@ -346,7 +346,7 @@ describe "Admin budget investments" do
|
|||||||
valuator = create(:valuator, user: user)
|
valuator = create(:valuator, user: user)
|
||||||
create(:budget_investment,
|
create(:budget_investment,
|
||||||
:with_administrator,
|
:with_administrator,
|
||||||
valuation_finished: false,
|
:unfinished,
|
||||||
title: "Investment without valuation",
|
title: "Investment without valuation",
|
||||||
budget: budget,
|
budget: budget,
|
||||||
valuators: [valuator])
|
valuators: [valuator])
|
||||||
|
|||||||
@@ -1263,7 +1263,7 @@ describe "Budget Investments" do
|
|||||||
|
|
||||||
investment = create(:budget_investment,
|
investment = create(:budget_investment,
|
||||||
:unfeasible,
|
:unfeasible,
|
||||||
valuation_finished: false,
|
:unfinished,
|
||||||
budget: budget,
|
budget: budget,
|
||||||
group: group,
|
group: group,
|
||||||
heading: heading,
|
heading: heading,
|
||||||
|
|||||||
@@ -1228,10 +1228,7 @@ describe Budget::Investment do
|
|||||||
let(:params) { { advanced_filters: ["under_valuation"], budget_id: budget.id } }
|
let(:params) { { advanced_filters: ["under_valuation"], budget_id: budget.id } }
|
||||||
it "returns only investment under valuation" do
|
it "returns only investment under valuation" do
|
||||||
valuator1 = create(:valuator)
|
valuator1 = create(:valuator)
|
||||||
investment1 = create(:budget_investment,
|
investment1 = create(:budget_investment, :with_administrator, :unfinished, budget: budget)
|
||||||
:with_administrator,
|
|
||||||
valuation_finished: false,
|
|
||||||
budget: budget)
|
|
||||||
investment1.valuators << valuator1
|
investment1.valuators << valuator1
|
||||||
create(:budget_investment, :with_administrator, budget: budget)
|
create(:budget_investment, :with_administrator, budget: budget)
|
||||||
create(:budget_investment, budget: budget)
|
create(:budget_investment, budget: budget)
|
||||||
|
|||||||
Reference in New Issue
Block a user