Commit fd9bc67c authored by Luke Duncalfe's avatar Luke Duncalfe
parent a5237380
- add_to_breadcrumbs _('Integrations'), scoped_integrations_path(project: project, group: group) - add_to_breadcrumbs _('Integrations'), scoped_integrations_path(project: @project, group: @group)
- breadcrumb_title @integration.title - breadcrumb_title @integration.title
- page_title @integration.title, _('Integrations') - page_title @integration.title, _('Integrations')
- @content_class = 'limit-container-width' unless fluid_layout - @content_class = 'limit-container-width' unless fluid_layout
......
...@@ -105,40 +105,4 @@ RSpec.describe Admin::IntegrationsController do ...@@ -105,40 +105,4 @@ RSpec.describe Admin::IntegrationsController do
.and change { Integrations::Jira.inherit_from_id(integration.id).count }.by(-1) .and change { Integrations::Jira.inherit_from_id(integration.id).count }.by(-1)
end end
end end
describe '#overrides' do
let_it_be(:instance_integration) { create(:bugzilla_integration, :instance) }
let_it_be(:non_overridden_integration) { create(:bugzilla_integration, inherit_from_id: instance_integration.id) }
let_it_be(:overridden_integration) { create(:bugzilla_integration) }
let_it_be(:overridden_other_integration) { create(:confluence_integration) }
subject do
get :overrides, params: { id: instance_integration.class.to_param }, format: format
end
context 'when format is JSON' do
let(:format) { :json }
include_context 'JSON response'
it 'returns projects with overrides', :aggregate_failures do
subject
expect(response).to have_gitlab_http_status(:ok)
expect(response).to include_pagination_headers
expect(json_response).to contain_exactly(a_hash_including('full_name' => overridden_integration.project.full_name))
end
end
context 'when format is HTML' do
let(:format) { :html }
it 'renders template' do
subject
expect(response).to render_template 'shared/integrations/overrides'
expect(assigns(:integration)).to eq(instance_integration)
end
end
end
end end
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe Admin::IntegrationsController, :enable_admin_mode do
let_it_be(:admin) { create(:admin) }
before do
sign_in(admin)
end
describe 'GET #overrides' do
let_it_be(:integration) { create(:jira_integration, :instance) }
let_it_be(:overridden_integration) { create(:jira_integration) }
let_it_be(:overridden_other_integration) { create(:confluence_integration) }
let(:overrides_path) { overrides_admin_application_settings_integration_path(integration, format: format) }
context 'format html' do
let(:format) { :html }
it 'renders' do
get overrides_path
expect(response).to have_gitlab_http_status(:ok)
expect(response).to render_template('shared/integrations/overrides')
end
end
context 'format json' do
let(:format) { :json }
let(:project) { overridden_integration.project }
it 'returns the project overrides data' do
get overrides_path
expect(response).to have_gitlab_http_status(:ok)
expect(response).to include_pagination_headers
expect(json_response).to contain_exactly(
{
'avatar_url' => project.avatar_url,
'full_name' => project.full_name,
'name' => project.name,
'full_path' => project_path(project)
}
)
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment