From 4d6231105f7a087fea8640a99cbf13a864e02551 Mon Sep 17 00:00:00 2001 From: David Cook Date: Mon, 11 Aug 2025 14:21:20 +1000 Subject: [PATCH] Assign attribute directly instead of mocking It's better to set a variable the same way the real code would Co-authored-by: Maikel --- spec/support/shared_examples/email_header_examples.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/support/shared_examples/email_header_examples.rb b/spec/support/shared_examples/email_header_examples.rb index c23d6403a3..0b68a6b127 100644 --- a/spec/support/shared_examples/email_header_examples.rb +++ b/spec/support/shared_examples/email_header_examples.rb @@ -9,7 +9,7 @@ end RSpec.shared_examples 'non-customer facing email with active white labelling' do |mail| context 'when hide OFN navigation is enabled for the distributor of the order' do before do - allow(order.distributor).to receive(:hide_ofn_navigation).and_return(true) + order.distributor.hide_ofn_navigation = true end it 'still displays the OFN header with logo' do @@ -21,7 +21,7 @@ end RSpec.shared_examples 'customer facing email with active white labelling' do |mail| context 'when hide OFN navigation is enabled for the distributor of the order' do before do - allow(order.distributor).to receive(:hide_ofn_navigation).and_return(true) + order.distributor.hide_ofn_navigation = true end it 'does not display the OFN header and logo' do