Assign attribute directly instead of mocking

It's better to set a variable the same way the real code would

Co-authored-by: Maikel <maikel@email.org.au>
This commit is contained in:
David Cook
2025-08-11 14:21:20 +10:00
committed by Konrad
parent 3a75c3446e
commit 4d6231105f

View File

@@ -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