Merge pull request #10980 from colinux/helpscout-more-validation

ETQ tech, réduit le bruit Helpscout sur Sentry
This commit is contained in:
Paul Chavard 2024-10-24 09:31:51 +00:00 committed by GitHub
commit c56aa67297
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 24 additions and 0 deletions

View file

@ -110,5 +110,21 @@ RSpec.describe HelpscoutCreateConversationJob, type: :job do
end
end
end
context 'when max attempts are reached' do
before do
allow(api).to receive(:create_conversation).and_raise(StandardError)
allow_any_instance_of(described_class).to receive(:executions).and_return(described_class.new.max_attempts)
end
it 'deletes the contact form' do
expect { subject }.to raise_error(StandardError)
expect(contact_form).to be_destroyed
end
it 'does not enqueue the job again' do
expect { subject rescue nil }.not_to have_enqueued_job(described_class)
end
end
end
end