Skip to content

Commit 64eb7d6

Browse files
committed
Fix unit tests
1 parent c573cbb commit 64eb7d6

1 file changed

Lines changed: 12 additions & 3 deletions

File tree

test/unit/account_test.rb

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,10 @@ class DestroyTest < ActiveSupport::TestCase
755755
ActiveMerchant::Billing::BogusGateway.any_instance.expects(:unstore).never
756756

757757
::Sidekiq::Testing.inline! do
758-
provider.destroy!
758+
# Prevent exception when deserializing ProviderDomainsChangedEvent with a non-existing (destroyed) provider
759+
suppress(ActiveJob::DeserializationError) do
760+
provider.destroy!
761+
end
759762
end
760763

761764
# TODO: master should not be emailed about events related to schduled_for_deletion providers
@@ -768,7 +771,10 @@ class DestroyTest < ActiveSupport::TestCase
768771
provider.schedule_for_deletion!
769772

770773
::Sidekiq::Testing.inline! do
771-
provider.destroy!
774+
# Prevent exception when deserializing ProviderDomainsChangedEvent with a non-existing (destroyed) provider
775+
suppress(ActiveJob::DeserializationError) do
776+
provider.destroy!
777+
end
772778
end
773779

774780
# TODO: master should not be notified about deleted scheduled for deletion providers for any reason
@@ -781,7 +787,10 @@ class DestroyTest < ActiveSupport::TestCase
781787
provider.schedule_for_deletion!
782788

783789
::Sidekiq::Testing.inline! do
784-
provider.destroy!
790+
# Prevent exception when deserializing ProviderDomainsChangedEvent with a non-existing (destroyed) provider
791+
suppress(ActiveJob::DeserializationError) do
792+
provider.destroy!
793+
end
785794
end
786795

787796
# TODO: master should not be notified about deleted scheduled for deletion providers for any reason

0 commit comments

Comments
 (0)