From 1f048e4716763e5cc753218a025a511bd0c9dd90 Mon Sep 17 00:00:00 2001 From: Arthur Campbell Date: Mon, 27 May 2024 16:01:57 +0100 Subject: [PATCH] time reduced from ~1.4 to 0.27 --- spec/components/sales_log_summary_component_spec.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/spec/components/sales_log_summary_component_spec.rb b/spec/components/sales_log_summary_component_spec.rb index 68f55184b..8635873af 100644 --- a/spec/components/sales_log_summary_component_spec.rb +++ b/spec/components/sales_log_summary_component_spec.rb @@ -1,12 +1,16 @@ require "rails_helper" RSpec.describe SalesLogSummaryComponent, type: :component do - let(:support_user) { FactoryBot.create(:user, :support) } - let(:coordinator_user) { FactoryBot.create(:user) } + let(:support_user) { build(:user, :support) } + let(:coordinator_user) { build(:user) } let(:purchid) { "62863" } let(:ownershipsch) { "0" } let(:saledate) { Time.zone.today } - let(:sales_log) { FactoryBot.create(:sales_log, ownershipsch:, purchid:, saledate:) } + let(:sales_log) { build(:sales_log, ownershipsch:, purchid:, saledate:) } + + before do + allow(sales_log).to receive(:id).and_return 1 + end context "when rendering sales log for a support user" do it "shows the log summary with organisational relationships" do