Commit 0481fdff authored by Siddharth Asthana's avatar Siddharth Asthana Committed by Peter Leitzen

Pass formats explicitly when rendering .html format

Changelog: other
parent eee5d278
......@@ -246,19 +246,19 @@ class ApplicationController < ActionController::Base
end
def git_not_found!
render "errors/git_not_found.html", layout: "errors", status: :not_found
render template: "errors/git_not_found", formats: :html, layout: "errors", status: :not_found
end
def render_403
respond_to do |format|
format.html { render "errors/access_denied", layout: "errors", status: :forbidden }
format.html { render template: "errors/access_denied", formats: :html, layout: "errors", status: :forbidden }
format.any { head :forbidden }
end
end
def render_404
respond_to do |format|
format.html { render "errors/not_found", layout: "errors", status: :not_found }
format.html { render template: "errors/not_found", formats: :html, layout: "errors", status: :not_found }
# Prevent the Rails CSRF protector from thinking a missing .js file is a JavaScript file
format.js { render json: '', status: :not_found, content_type: 'application/json' }
format.any { head :not_found }
......
......@@ -6,7 +6,7 @@
- if Gitlab::ServiceDesk.supported?
.empty-state
.svg-content
= render 'shared/empty_states/icons/service_desk_empty_state.svg'
= render partial: 'shared/empty_states/icons/service_desk_empty_state', formats: :svg
.text-content
%h4= title_text
......@@ -25,7 +25,7 @@
- else
.empty-state
.svg-content
= render 'shared/empty_states/icons/service_desk_setup.svg'
= render partial: 'shared/empty_states/icons/service_desk_setup', formats: :svg
.text-content
- if can_edit_project_settings
%h4= s_('ServiceDesk|Service Desk is not supported')
......
......@@ -9,7 +9,8 @@ RSpec.describe 'admin/users/_credit_card_info.html.haml', :saas do
def render
super(
partial: 'admin/users/credit_card_info.html.haml',
partial: 'admin/users/credit_card_info',
formats: :html,
locals: { user: user }
)
end
......
......@@ -33,7 +33,7 @@ RSpec.describe 'projects/commits/_commit.html.haml' do
let(:ref) { GpgHelpers::SIGNED_COMMIT_SHA }
it 'does not display a loading spinner for GPG status' do
render partial: template, locals: {
render partial: template, formats: :html, locals: {
project: project,
ref: ref,
commit: commit
......@@ -69,7 +69,7 @@ RSpec.describe 'projects/commits/_commit.html.haml' do
end
it 'does not display a ci status icon' do
render partial: template, locals: {
render partial: template, formats: :html, locals: {
project: project,
ref: ref,
commit: commit
......@@ -85,7 +85,7 @@ RSpec.describe 'projects/commits/_commit.html.haml' do
end
it 'does display a ci status icon when pipelines are enabled' do
render partial: template, locals: {
render partial: template, formats: :html, locals: {
project: project,
ref: ref,
commit: commit
......
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