Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/controllers/admin/integrations_controller_spec.rb')
-rw-r--r--spec/controllers/admin/integrations_controller_spec.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/spec/controllers/admin/integrations_controller_spec.rb b/spec/controllers/admin/integrations_controller_spec.rb
index 817223bd91a..7e7b60db2dc 100644
--- a/spec/controllers/admin/integrations_controller_spec.rb
+++ b/spec/controllers/admin/integrations_controller_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-describe Admin::IntegrationsController do
+RSpec.describe Admin::IntegrationsController do
let(:admin) { create(:admin) }
before do
@@ -36,7 +36,9 @@ describe Admin::IntegrationsController do
let(:integration) { create(:jira_service, :instance) }
before do
- put :update, params: { id: integration.class.to_param, service: { url: url } }
+ allow(PropagateIntegrationWorker).to receive(:perform_async)
+
+ put :update, params: { id: integration.class.to_param, overwrite: true, service: { url: url } }
end
context 'valid params' do
@@ -46,6 +48,10 @@ describe Admin::IntegrationsController do
expect(response).to have_gitlab_http_status(:found)
expect(integration.reload.url).to eq(url)
end
+
+ it 'calls to PropagateIntegrationWorker' do
+ expect(PropagateIntegrationWorker).to have_received(:perform_async).with(integration.id, true)
+ end
end
context 'invalid params' do
@@ -56,6 +62,10 @@ describe Admin::IntegrationsController do
expect(response).to render_template(:edit)
expect(integration.reload.url).not_to eq(url)
end
+
+ it 'does not call to PropagateIntegrationWorker' do
+ expect(PropagateIntegrationWorker).not_to have_received(:perform_async)
+ end
end
end
end