diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-04 00:09:37 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-04 00:09:37 +0000 |
commit | e3bdfa1a13d7e6c92716324c78b5b20c07eeb7c6 (patch) | |
tree | e8776263096b027d32d4be5118cccc87b00de2bc /spec/controllers/admin/integrations_controller_spec.rb | |
parent | c1a50b8195f4e36fda9b233acbde57a449bcf6c3 (diff) | |
download | gitlab-ce-e3bdfa1a13d7e6c92716324c78b5b20c07eeb7c6.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/controllers/admin/integrations_controller_spec.rb')
-rw-r--r-- | spec/controllers/admin/integrations_controller_spec.rb | 34 |
1 files changed, 4 insertions, 30 deletions
diff --git a/spec/controllers/admin/integrations_controller_spec.rb b/spec/controllers/admin/integrations_controller_spec.rb index 50748918893..8e48ecddd0f 100644 --- a/spec/controllers/admin/integrations_controller_spec.rb +++ b/spec/controllers/admin/integrations_controller_spec.rb @@ -3,7 +3,6 @@ require 'spec_helper' describe Admin::IntegrationsController do - let_it_be(:project) { create(:project) } let(:admin) { create(:admin) } before do @@ -34,7 +33,7 @@ describe Admin::IntegrationsController do end describe '#update' do - let(:integration) { create(:jira_service, project: project) } + let(:integration) { create(:jira_service, :instance) } before do put :update, params: { id: integration.class.to_param, service: { url: url } } @@ -52,34 +51,9 @@ describe Admin::IntegrationsController do context 'invalid params' do let(:url) { 'https://jira.localhost' } - it 'does not update the integration' do - expect(response).to have_gitlab_http_status(:ok) - expect(response).to render_template(:edit) - expect(integration.reload.url).not_to eq(url) - end - end - end - - describe '#test' do - context 'testable' do - let(:integration) { create(:jira_service, project: project) } - - it 'returns ok' do - allow_any_instance_of(integration.class).to receive(:test) { { success: true } } - - put :test, params: { id: integration.class.to_param } - - expect(response).to have_gitlab_http_status(:ok) - end - end - - context 'not testable' do - let(:integration) { create(:alerts_service, project: project) } - - it 'returns not found' do - put :test, params: { id: integration.class.to_param } - - expect(response).to have_gitlab_http_status(:not_found) + it 'updates the integration' do + expect(response).to have_gitlab_http_status(:found) + expect(integration.reload.url).to eq(url) end end end |