Browse Source

Try to prevent flaky test behaviour

pull/3003/head
Manny Dinssa 2 months ago
parent
commit
8bac9a1bc4
  1. 6
      spec/lib/tasks/update_manual_address_entry_selected_prexisting_logs_spec.rb

6
spec/lib/tasks/update_manual_address_entry_selected_prexisting_logs_spec.rb

@ -13,7 +13,7 @@ RSpec.describe "bulk_update:update_manual_address_entry_selected", type: :task d
end end
let(:lettings_log_address_manually_entered) do let(:lettings_log_address_manually_entered) do
build(:lettings_log, :completed_without_uprn, startdate: Time.zone.local(2024, 12, 1), needstype: 1, manual_address_entry_selected: false) build(:lettings_log, :completed_without_uprn, startdate: Time.zone.local(2024, 12, 1), needstype: 1)
end end
let(:sales_log_uprn_entered) do let(:sales_log_uprn_entered) do
@ -25,7 +25,7 @@ RSpec.describe "bulk_update:update_manual_address_entry_selected", type: :task d
end end
let(:sales_log_address_manually_entered) do let(:sales_log_address_manually_entered) do
build(:sales_log, :completed_without_uprn, saledate: Time.zone.local(2024, 12, 30), manual_address_entry_selected: false) build(:sales_log, :completed_without_uprn, saledate: Time.zone.local(2024, 12, 30))
end end
before do before do
@ -65,7 +65,9 @@ RSpec.describe "bulk_update:update_manual_address_entry_selected", type: :task d
context "when logs do meet the criteria" do context "when logs do meet the criteria" do
before do before do
lettings_log_address_manually_entered.manual_address_entry_selected = false
lettings_log_address_manually_entered.save!(validate: false) lettings_log_address_manually_entered.save!(validate: false)
sales_log_address_manually_entered.manual_address_entry_selected = false
sales_log_address_manually_entered.save!(validate: false) sales_log_address_manually_entered.save!(validate: false)
end end

Loading…
Cancel
Save