Follow up 02417225f7d3060cddda062cc1bd51b32e75deaf- Fixes #3372 - Applied missing Trigger condition changes to Tests introduced by fixing #3416.

This commit is contained in:
Thorsten Eckel 2021-02-23 17:01:02 +01:00
parent 02417225f7
commit 9e8f85477d

View file

@ -4,6 +4,13 @@ RSpec.describe TriggerWebhookJob, type: :job do
let(:endpoint) { 'http://api.example.com/webhook' } let(:endpoint) { 'http://api.example.com/webhook' }
let(:token) { 's3cr3t-t0k3n' } let(:token) { 's3cr3t-t0k3n' }
let(:webhook) { create(:webhook, endpoint: endpoint, signature_token: token) }
let(:trigger) do
create(:trigger,
perform: {
'notification.webhook' => { 'webhook_id' => webhook.id }
})
end
context 'when serialized model argument gets deleted' do context 'when serialized model argument gets deleted' do
@ -12,16 +19,6 @@ RSpec.describe TriggerWebhookJob, type: :job do
let(:ticket) { create(:ticket) } let(:ticket) { create(:ticket) }
let(:article) { create(:'ticket/article') } let(:article) { create(:'ticket/article') }
let(:trigger) do
create(:trigger,
perform: {
'notification.webhook' => {
endpoint: endpoint,
token: token
}
})
end
shared_examples 'handle deleted argument models' do shared_examples 'handle deleted argument models' do
it 'raises no error' do it 'raises no error' do
expect { ActiveJob::Base.execute job.serialize }.not_to raise_error expect { ActiveJob::Base.execute job.serialize }.not_to raise_error
@ -62,15 +59,6 @@ RSpec.describe TriggerWebhookJob, type: :job do
let!(:ticket) { create(:ticket) } let!(:ticket) { create(:ticket) }
let!(:article) { create(:'ticket/article') } let!(:article) { create(:'ticket/article') }
let(:webhook) { create(:webhook, endpoint: endpoint, signature_token: token) }
let(:trigger) do
create(:trigger,
perform: {
'notification.webhook' => { 'webhook_id' => webhook.id }
})
end
let(:response_status) { 200 } let(:response_status) { 200 }
let(:payload) do let(:payload) do
{ {