summaryrefslogtreecommitdiff
path: root/spec/controllers/admin/services_controller_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/controllers/admin/services_controller_spec.rb')
-rw-r--r--spec/controllers/admin/services_controller_spec.rb22
1 files changed, 21 insertions, 1 deletions
diff --git a/spec/controllers/admin/services_controller_spec.rb b/spec/controllers/admin/services_controller_spec.rb
index 2ad4989af4f..8e78cc75369 100644
--- a/spec/controllers/admin/services_controller_spec.rb
+++ b/spec/controllers/admin/services_controller_spec.rb
@@ -10,7 +10,7 @@ RSpec.describe Admin::ServicesController do
end
describe 'GET #edit' do
- let!(:service) do
+ let(:service) do
create(:jira_service, :template)
end
@@ -19,6 +19,26 @@ RSpec.describe Admin::ServicesController do
expect(response).to have_gitlab_http_status(:ok)
end
+
+ context 'when integration does not exists' do
+ it 'redirects to the admin application integration page' do
+ get :edit, params: { id: 'invalid' }
+
+ expect(response).to redirect_to(admin_application_settings_services_path)
+ end
+ end
+
+ context 'when instance integration exists' do
+ before do
+ create(:jira_service, :instance)
+ end
+
+ it 'redirects to the admin application integration page' do
+ get :edit, params: { id: service.id }
+
+ expect(response).to redirect_to(admin_application_settings_services_path)
+ end
+ end
end
describe "#update" do