From 6ca6b8b77d6841e67c0b0793fc28eee24ab76ced Mon Sep 17 00:00:00 2001 From: Igor Fedoronchuk Date: Tue, 11 Sep 2018 12:00:06 +0300 Subject: [PATCH] refs #362, added 204 to allowed http codes while cdr export file removal --- app/jobs/worker/remove_cdr_export_file_job.rb | 2 +- spec/jobs/worker/remove_cdr_export_file_job_spec.rb | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/jobs/worker/remove_cdr_export_file_job.rb b/app/jobs/worker/remove_cdr_export_file_job.rb index cc7a77a20..31b96f6db 100644 --- a/app/jobs/worker/remove_cdr_export_file_job.rb +++ b/app/jobs/worker/remove_cdr_export_file_job.rb @@ -13,7 +13,7 @@ def message end queue_as 'cdr_export' - ALLOWED_HTTP_CODES = [200, 404].freeze + ALLOWED_HTTP_CODES = [200, 204, 404].freeze def perform(cdr_export_id) url = URI.parse(delete_url(cdr_export_id)) diff --git a/spec/jobs/worker/remove_cdr_export_file_job_spec.rb b/spec/jobs/worker/remove_cdr_export_file_job_spec.rb index 99796f12d..5ebbbdd30 100644 --- a/spec/jobs/worker/remove_cdr_export_file_job_spec.rb +++ b/spec/jobs/worker/remove_cdr_export_file_job_spec.rb @@ -31,6 +31,14 @@ end end + context 'when http code 204' do + let(:http_code) do + 204 + end + + include_examples :valid_deleting + end + context 'when http code 200' do let(:http_code) do 200