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:
authorJames Lopez <james@jameslopez.es>2017-05-04 19:11:28 +0300
committerJames Lopez <james@jameslopez.es>2017-05-04 19:11:28 +0300
commitcf002738e766f977bdb0e857759f548a5c65c9bd (patch)
tree4162281ab28ac4eaf1f711e2f20c46125807397a /spec/controllers/admin
parent78d059141b5f3345d797992e03680654ce762c76 (diff)
refactor a few things based on feedback
Diffstat (limited to 'spec/controllers/admin')
-rw-r--r--spec/controllers/admin/services_controller_spec.rb32
1 files changed, 32 insertions, 0 deletions
diff --git a/spec/controllers/admin/services_controller_spec.rb b/spec/controllers/admin/services_controller_spec.rb
index e5cdd52307e..808c98edb7f 100644
--- a/spec/controllers/admin/services_controller_spec.rb
+++ b/spec/controllers/admin/services_controller_spec.rb
@@ -23,4 +23,36 @@ describe Admin::ServicesController do
end
end
end
+
+ describe "#update" do
+ let(:project) { create(:empty_project) }
+ let!(:service) do
+ RedmineService.create(
+ project: project,
+ active: false,
+ template: true,
+ properties: {
+ project_url: 'http://abc',
+ issues_url: 'http://abc',
+ new_issue_url: 'http://abc'
+ }
+ )
+ end
+
+ it 'updates the service params successfully and calls the propagation worker' do
+ expect(PropagateProjectServiceWorker).to receive(:perform_async).with(service.id)
+
+ put :update, id: service.id, service: { active: true }
+
+ expect(response).to have_http_status(302)
+ end
+
+ it 'updates the service params successfully' do
+ expect(PropagateProjectServiceWorker).not_to receive(:perform_async)
+
+ put :update, id: service.id, service: { properties: {} }
+
+ expect(response).to have_http_status(302)
+ end
+ end
end