diff options
author | Mayra Cabrera <mcabrera@gitlab.com> | 2018-01-04 09:33:51 +0000 |
---|---|---|
committer | Kamil TrzciĆski <ayufan@ayufan.eu> | 2018-01-04 09:33:51 +0000 |
commit | e028d795c484dcd1030b4f6bba8f53d4e677f0b3 (patch) | |
tree | 4471dd62763aa97e21d12a2ef75fcec612ca6785 /spec/controllers/projects/services_controller_spec.rb | |
parent | 0e7e9e32b30bd3c310a769eaef91843b609697df (diff) | |
download | gitlab-ce-e028d795c484dcd1030b4f6bba8f53d4e677f0b3.tar.gz |
41054-Disallow creation of new Kubernetes integrations
Diffstat (limited to 'spec/controllers/projects/services_controller_spec.rb')
-rw-r--r-- | spec/controllers/projects/services_controller_spec.rb | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/spec/controllers/projects/services_controller_spec.rb b/spec/controllers/projects/services_controller_spec.rb index 2c6ad00515e..847ac6f2be0 100644 --- a/spec/controllers/projects/services_controller_spec.rb +++ b/spec/controllers/projects/services_controller_spec.rb @@ -114,5 +114,41 @@ describe Projects::ServicesController do expect(flash[:notice]).to eq 'HipChat settings saved, but not activated.' end end + + context 'with a deprecated service' do + let(:service) { create(:kubernetes_service, project: project) } + + before do + put :update, + namespace_id: project.namespace, project_id: project, id: service.to_param, service: { namespace: 'updated_namespace' } + end + + it 'should not update the service' do + service.reload + expect(service.namespace).not_to eq('updated_namespace') + end + end + end + + describe "GET #edit" do + before do + get :edit, namespace_id: project.namespace, project_id: project, id: service_id + end + + context 'with approved services' do + let(:service_id) { 'jira' } + + it 'should render edit page' do + expect(response).to be_success + end + end + + context 'with a deprecated service' do + let(:service_id) { 'kubernetes' } + + it 'should render edit page' do + expect(response).to be_success + end + end end end |