Add latest changes from gitlab-org/gitlab@master

This commit is contained in:
GitLab Bot 2022-11-14 06:11:42 +00:00
parent 3f2ce963ab
commit ab44099309
2 changed files with 13 additions and 19 deletions

View File

@ -112,7 +112,7 @@ class GroupsController < Groups::ApplicationController
def details
respond_to do |format|
format.html do
render_details_html
redirect_to group_path(group)
end
format.atom do
@ -236,10 +236,6 @@ class GroupsController < Groups::ApplicationController
render 'groups/show', locals: { trial: params[:trial] }
end
def render_details_html
render 'groups/show'
end
def render_details_view_atom
load_events
render layout: 'xml', template: 'groups/show'

View File

@ -42,23 +42,17 @@ RSpec.describe GroupsController, factory_default: :keep do
end
end
shared_examples 'details view' do
let(:namespace) { group }
it { is_expected.to render_template('groups/show') }
context 'as atom' do
shared_examples 'details view as atom' do
let!(:event) { create(:event, project: project) }
let(:format) { :atom }
it { is_expected.to render_template('groups/show') }
it 'assigns events for all the projects in the group', :sidekiq_might_not_need_inline do
it 'assigns events for all the projects in the group' do
subject
expect(assigns(:events).map(&:id)).to contain_exactly(event.id)
end
end
end
describe 'GET #show' do
before do
@ -70,7 +64,9 @@ RSpec.describe GroupsController, factory_default: :keep do
subject { get :show, params: { id: group.to_param }, format: format }
context 'when the group is not importing' do
it_behaves_like 'details view'
it { is_expected.to render_template('groups/show') }
it_behaves_like 'details view as atom'
it 'tracks page views', :snowplow do
subject
@ -115,7 +111,9 @@ RSpec.describe GroupsController, factory_default: :keep do
subject { get :details, params: { id: group.to_param }, format: format }
it_behaves_like 'details view'
it { is_expected.to redirect_to(group_path(group)) }
it_behaves_like 'details view as atom'
end
describe 'GET edit' do