Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
cd06e389
Commit
cd06e389
authored
Jan 10, 2019
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
16d9aa7a
59c0c173
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
1 deletion
+69
-1
.gitlab/issue_templates/Add style proposal
.gitlab/issue_templates/Add style proposal
+16
-0
app/controllers/admin/requests_profiles_controller.rb
app/controllers/admin/requests_profiles_controller.rb
+1
-1
changelogs/unreleased/sh-fix-request-profiles-html.yml
changelogs/unreleased/sh-fix-request-profiles-html.yml
+5
-0
spec/controllers/admin/requests_profiles_controller_spec.rb
spec/controllers/admin/requests_profiles_controller_spec.rb
+47
-0
No files found.
.gitlab/issue_templates/Add style proposal
0 → 100644
View file @
cd06e389
## Description of the proposal
<!--
Please describe the proposal and add a link to the source (for example, http://www.betterspecs.org/).
-->
- [ ] Mention the proposal in the next backend weekly call and the #backend channel to encourage contribution
- [ ] Proceed with the proposal once 50% of the maintainers have weighed in, and 80% of the votes are :+1:
- [ ] Once approved, mention it again in the next backend weekly call and the #backend channel
/label ~"development guidelines"
/label ~"Style decision"
/label ~Documentation
/cc @gitlab-org/maintainers/rails-backend
app/controllers/admin/requests_profiles_controller.rb
View file @
cd06e389
...
@@ -11,7 +11,7 @@ class Admin::RequestsProfilesController < Admin::ApplicationController
...
@@ -11,7 +11,7 @@ class Admin::RequestsProfilesController < Admin::ApplicationController
profile
=
Gitlab
::
RequestProfiler
::
Profile
.
find
(
clean_name
)
profile
=
Gitlab
::
RequestProfiler
::
Profile
.
find
(
clean_name
)
if
profile
if
profile
render
html:
profile
.
content
render
html:
profile
.
content
.
html_safe
else
else
redirect_to
admin_requests_profiles_path
,
alert:
'Profile not found'
redirect_to
admin_requests_profiles_path
,
alert:
'Profile not found'
end
end
...
...
changelogs/unreleased/sh-fix-request-profiles-html.yml
0 → 100644
View file @
cd06e389
---
title
:
Fix requests profiler in admin page not rendering HTML properly
merge_request
:
24291
author
:
type
:
fixed
spec/controllers/admin/requests_profiles_controller_spec.rb
0 → 100644
View file @
cd06e389
# frozen_string_literal: true
require
'spec_helper'
describe
Admin
::
RequestsProfilesController
do
set
(
:admin
)
{
create
(
:admin
)
}
before
do
sign_in
(
admin
)
end
describe
'#show'
do
let
(
:basename
)
{
"profile_
#{
Time
.
now
.
to_i
}
.html"
}
let
(
:tmpdir
)
{
Dir
.
mktmpdir
(
'profiler-test'
)
}
let
(
:test_file
)
{
File
.
join
(
tmpdir
,
basename
)
}
let
(
:profile
)
{
Gitlab
::
RequestProfiler
::
Profile
.
new
(
basename
)
}
let
(
:sample_data
)
do
<<~
HTML
<!DOCTYPE html>
<html>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
</html>
HTML
end
before
do
stub_const
(
'Gitlab::RequestProfiler::PROFILES_DIR'
,
tmpdir
)
output
=
File
.
open
(
test_file
,
'w'
)
output
.
write
(
sample_data
)
output
.
close
end
after
do
File
.
unlink
(
test_file
)
end
it
'loads an HTML profile'
do
get
:show
,
params:
{
name:
basename
}
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
response
.
body
).
to
eq
(
sample_data
)
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment