From bb79274ffea70ebc937dcdfdf8e19ea2fc589538 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Tue, 18 Jul 2023 21:54:14 +0200 Subject: [PATCH] Simplify creating investments with the same heading --- spec/system/advanced_search_spec.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/spec/system/advanced_search_spec.rb b/spec/system/advanced_search_spec.rb index cb95cfc6a..12517920d 100644 --- a/spec/system/advanced_search_spec.rb +++ b/spec/system/advanced_search_spec.rb @@ -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)