Commit d1c90eee authored by Peter Leitzen's avatar Peter Leitzen

Fix deprecation warning when rendering "xml.atom"

This fixes the following deprecation warning:

  DEPRECATION WARNING: Rendering actions with '.' in the name is
  deprecated: layouts/xml.atom (called from render at
  /builds/gitlab-org/gitlab/app/controllers/application_controller.rb:133)
parent 257d5598
......@@ -17,7 +17,7 @@ module IssuableCollectionsAction
respond_to do |format|
format.html
format.atom { render layout: 'xml.atom' }
format.atom { render layout: 'xml' }
end
end
......
......@@ -23,7 +23,7 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
end
format.atom do
load_events
render layout: 'xml.atom'
render layout: 'xml'
end
format.json do
render json: {
......
......@@ -235,7 +235,7 @@ class GroupsController < Groups::ApplicationController
def render_details_view_atom
load_events
render layout: 'xml.atom', template: 'groups/show'
render layout: 'xml', template: 'groups/show'
end
# rubocop: disable CodeReuse/ActiveRecord
......
......@@ -30,7 +30,7 @@ class Projects::CommitsController < Projects::ApplicationController
respond_to do |format|
format.html
format.atom { render layout: 'xml.atom' }
format.atom { render layout: 'xml' }
format.json do
pager_json(
......
......@@ -81,7 +81,7 @@ class Projects::IssuesController < Projects::ApplicationController
respond_to do |format|
format.html
format.atom { render layout: 'xml.atom' }
format.atom { render layout: 'xml' }
format.json do
render json: {
html: view_to_html_string("projects/issues/_issues"),
......
......@@ -93,7 +93,7 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
respond_to do |format|
format.html
format.atom { render layout: 'xml.atom' }
format.atom { render layout: 'xml' }
format.json do
render json: {
html: view_to_html_string("projects/merge_requests/_merge_requests")
......
......@@ -42,7 +42,7 @@ class Projects::TagsController < Projects::ApplicationController
status = @tags_loading_error ? :service_unavailable : :ok
format.html { render status: status }
format.atom { render layout: 'xml.atom', status: status }
format.atom { render layout: 'xml', status: status }
end
end
# rubocop: enable CodeReuse/ActiveRecord
......
......@@ -173,7 +173,7 @@ class ProjectsController < Projects::ApplicationController
format.atom do
load_events
@events = @events.select { |event| event.visible_to_user?(current_user) }
render layout: 'xml.atom'
render layout: 'xml'
end
end
end
......
......@@ -35,7 +35,7 @@ class UsersController < ApplicationController
format.atom do
load_events
render layout: 'xml.atom'
render layout: 'xml'
end
format.json do
......
......@@ -1590,14 +1590,18 @@ RSpec.describe ProjectsController do
get :show, format: :atom, params: { id: public_project, namespace_id: public_project.namespace }
expect(response).to render_template('xml.atom')
expect(response).to have_gitlab_http_status(:success)
expect(response).to render_template(:show)
expect(response).to render_template(layout: :xml)
expect(assigns(:events)).to eq([event])
end
it 'filters by calling event.visible_to_user?' do
get :show, format: :atom, params: { id: public_project, namespace_id: public_project.namespace }
expect(response).to render_template('xml.atom')
expect(response).to have_gitlab_http_status(:success)
expect(response).to render_template(:show)
expect(response).to render_template(layout: :xml)
expect(assigns(:events)).to eq([event])
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