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 ...@@ -17,7 +17,7 @@ module IssuableCollectionsAction
respond_to do |format| respond_to do |format|
format.html format.html
format.atom { render layout: 'xml.atom' } format.atom { render layout: 'xml' }
end end
end end
......
...@@ -23,7 +23,7 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController ...@@ -23,7 +23,7 @@ class Dashboard::ProjectsController < Dashboard::ApplicationController
end end
format.atom do format.atom do
load_events load_events
render layout: 'xml.atom' render layout: 'xml'
end end
format.json do format.json do
render json: { render json: {
......
...@@ -235,7 +235,7 @@ class GroupsController < Groups::ApplicationController ...@@ -235,7 +235,7 @@ class GroupsController < Groups::ApplicationController
def render_details_view_atom def render_details_view_atom
load_events load_events
render layout: 'xml.atom', template: 'groups/show' render layout: 'xml', template: 'groups/show'
end end
# rubocop: disable CodeReuse/ActiveRecord # rubocop: disable CodeReuse/ActiveRecord
......
...@@ -30,7 +30,7 @@ class Projects::CommitsController < Projects::ApplicationController ...@@ -30,7 +30,7 @@ class Projects::CommitsController < Projects::ApplicationController
respond_to do |format| respond_to do |format|
format.html format.html
format.atom { render layout: 'xml.atom' } format.atom { render layout: 'xml' }
format.json do format.json do
pager_json( pager_json(
......
...@@ -81,7 +81,7 @@ class Projects::IssuesController < Projects::ApplicationController ...@@ -81,7 +81,7 @@ class Projects::IssuesController < Projects::ApplicationController
respond_to do |format| respond_to do |format|
format.html format.html
format.atom { render layout: 'xml.atom' } format.atom { render layout: 'xml' }
format.json do format.json do
render json: { render json: {
html: view_to_html_string("projects/issues/_issues"), html: view_to_html_string("projects/issues/_issues"),
......
...@@ -93,7 +93,7 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo ...@@ -93,7 +93,7 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
respond_to do |format| respond_to do |format|
format.html format.html
format.atom { render layout: 'xml.atom' } format.atom { render layout: 'xml' }
format.json do format.json do
render json: { render json: {
html: view_to_html_string("projects/merge_requests/_merge_requests") html: view_to_html_string("projects/merge_requests/_merge_requests")
......
...@@ -42,7 +42,7 @@ class Projects::TagsController < Projects::ApplicationController ...@@ -42,7 +42,7 @@ class Projects::TagsController < Projects::ApplicationController
status = @tags_loading_error ? :service_unavailable : :ok status = @tags_loading_error ? :service_unavailable : :ok
format.html { render status: status } format.html { render status: status }
format.atom { render layout: 'xml.atom', status: status } format.atom { render layout: 'xml', status: status }
end end
end end
# rubocop: enable CodeReuse/ActiveRecord # rubocop: enable CodeReuse/ActiveRecord
......
...@@ -173,7 +173,7 @@ class ProjectsController < Projects::ApplicationController ...@@ -173,7 +173,7 @@ class ProjectsController < Projects::ApplicationController
format.atom do format.atom do
load_events load_events
@events = @events.select { |event| event.visible_to_user?(current_user) } @events = @events.select { |event| event.visible_to_user?(current_user) }
render layout: 'xml.atom' render layout: 'xml'
end end
end end
end end
......
...@@ -35,7 +35,7 @@ class UsersController < ApplicationController ...@@ -35,7 +35,7 @@ class UsersController < ApplicationController
format.atom do format.atom do
load_events load_events
render layout: 'xml.atom' render layout: 'xml'
end end
format.json do format.json do
......
...@@ -1590,14 +1590,18 @@ RSpec.describe ProjectsController do ...@@ -1590,14 +1590,18 @@ RSpec.describe ProjectsController do
get :show, format: :atom, params: { id: public_project, namespace_id: public_project.namespace } 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]) expect(assigns(:events)).to eq([event])
end end
it 'filters by calling event.visible_to_user?' do it 'filters by calling event.visible_to_user?' do
get :show, format: :atom, params: { id: public_project, namespace_id: public_project.namespace } 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]) expect(assigns(:events)).to eq([event])
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