Simplify creating investments with the same heading

This commit is contained in:
Javi Martín
2023-07-18 21:54:14 +02:00
parent cebd6ddb30
commit bb79274ffe

View File

@@ -197,9 +197,13 @@ describe "Advanced search" do
Setting["feature.sdg"] = true
Setting["sdg.process.budgets"] = true
create(:budget_investment, heading: heading, title: "Get Schwifty", sdg_goals: [SDG::Goal[7]], created_at: 1.minute.ago)
create(:budget_investment, heading: heading, title: "Hello Schwifty", sdg_goals: [SDG::Goal[7]], created_at: 2.days.ago)
create(:budget_investment, heading: heading, title: "Save the forest")
[
{ title: "Get Schwifty", sdg_goals: [SDG::Goal[7]], created_at: 1.minute.ago },
{ title: "Hello Schwifty", sdg_goals: [SDG::Goal[7]], created_at: 2.days.ago },
{ title: "Save the forest" }
].each do |attributes|
create(:budget_investment, attributes.merge(heading: heading))
end
visit budget_investments_path(budget)