Commit 8e389d6a authored by Peter Leitzen's avatar Peter Leitzen

Merge branch 'issue_342492_key_details.html.haml_spec' into 'master'

Pass formats explicitly when rendering .html & .svg formats

See merge request gitlab-org/gitlab!75784
parents efc4c942 0481fdff
...@@ -246,19 +246,19 @@ class ApplicationController < ActionController::Base ...@@ -246,19 +246,19 @@ class ApplicationController < ActionController::Base
end end
def git_not_found! 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 end
def render_403 def render_403
respond_to do |format| 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 } format.any { head :forbidden }
end end
end end
def render_404 def render_404
respond_to do |format| 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 # 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.js { render json: '', status: :not_found, content_type: 'application/json' }
format.any { head :not_found } format.any { head :not_found }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
- if Gitlab::ServiceDesk.supported? - if Gitlab::ServiceDesk.supported?
.empty-state .empty-state
.svg-content .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 .text-content
%h4= title_text %h4= title_text
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
- else - else
.empty-state .empty-state
.svg-content .svg-content
= render 'shared/empty_states/icons/service_desk_setup.svg' = render partial: 'shared/empty_states/icons/service_desk_setup', formats: :svg
.text-content .text-content
- if can_edit_project_settings - if can_edit_project_settings
%h4= s_('ServiceDesk|Service Desk is not supported') %h4= s_('ServiceDesk|Service Desk is not supported')
......
...@@ -9,7 +9,8 @@ RSpec.describe 'admin/users/_credit_card_info.html.haml', :saas do ...@@ -9,7 +9,8 @@ RSpec.describe 'admin/users/_credit_card_info.html.haml', :saas do
def render def render
super( super(
partial: 'admin/users/credit_card_info.html.haml', partial: 'admin/users/credit_card_info',
formats: :html,
locals: { user: user } locals: { user: user }
) )
end end
......
...@@ -33,7 +33,7 @@ RSpec.describe 'projects/commits/_commit.html.haml' do ...@@ -33,7 +33,7 @@ RSpec.describe 'projects/commits/_commit.html.haml' do
let(:ref) { GpgHelpers::SIGNED_COMMIT_SHA } let(:ref) { GpgHelpers::SIGNED_COMMIT_SHA }
it 'does not display a loading spinner for GPG status' do it 'does not display a loading spinner for GPG status' do
render partial: template, locals: { render partial: template, formats: :html, locals: {
project: project, project: project,
ref: ref, ref: ref,
commit: commit commit: commit
...@@ -69,7 +69,7 @@ RSpec.describe 'projects/commits/_commit.html.haml' do ...@@ -69,7 +69,7 @@ RSpec.describe 'projects/commits/_commit.html.haml' do
end end
it 'does not display a ci status icon' do it 'does not display a ci status icon' do
render partial: template, locals: { render partial: template, formats: :html, locals: {
project: project, project: project,
ref: ref, ref: ref,
commit: commit commit: commit
...@@ -85,7 +85,7 @@ RSpec.describe 'projects/commits/_commit.html.haml' do ...@@ -85,7 +85,7 @@ RSpec.describe 'projects/commits/_commit.html.haml' do
end end
it 'does display a ci status icon when pipelines are enabled' do it 'does display a ci status icon when pipelines are enabled' do
render partial: template, locals: { render partial: template, formats: :html, locals: {
project: project, project: project,
ref: ref, ref: ref,
commit: commit 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