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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
d038fac4
Commit
d038fac4
authored
Jul 05, 2018
by
Oswaldo Ferreira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Present state indication on GFM preview
parent
26998c68
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
1 deletion
+34
-1
app/controllers/concerns/preview_markdown.rb
app/controllers/concerns/preview_markdown.rb
+1
-0
changelogs/unreleased/31583-osw-gfm-complete-status-indication.yml
...s/unreleased/31583-osw-gfm-complete-status-indication.yml
+5
-0
spec/controllers/projects_controller_spec.rb
spec/controllers/projects_controller_spec.rb
+28
-1
No files found.
app/controllers/concerns/preview_markdown.rb
View file @
d038fac4
...
@@ -10,6 +10,7 @@ module PreviewMarkdown
...
@@ -10,6 +10,7 @@ module PreviewMarkdown
when
'wikis'
then
{
pipeline: :wiki
,
project_wiki:
@project_wiki
,
page_slug:
params
[
:id
]
}
when
'wikis'
then
{
pipeline: :wiki
,
project_wiki:
@project_wiki
,
page_slug:
params
[
:id
]
}
when
'snippets'
then
{
skip_project_check:
true
}
when
'snippets'
then
{
skip_project_check:
true
}
when
'groups'
then
{
group:
group
}
when
'groups'
then
{
group:
group
}
when
'projects'
then
{
issuable_state_filter_enabled:
true
}
else
{}
else
{}
end
end
...
...
changelogs/unreleased/31583-osw-gfm-complete-status-indication.yml
0 → 100644
View file @
d038fac4
---
title
:
Present state indication on GFM preview
merge_request
:
author
:
type
:
added
spec/controllers/projects_controller_spec.rb
View file @
d038fac4
...
@@ -616,13 +616,40 @@ describe ProjectsController do
...
@@ -616,13 +616,40 @@ describe ProjectsController do
end
end
describe
'POST #preview_markdown'
do
describe
'POST #preview_markdown'
do
it
'renders json in a correct format'
do
before
do
sign_in
(
user
)
sign_in
(
user
)
end
it
'renders json in a correct format'
do
post
:preview_markdown
,
namespace_id:
public_project
.
namespace
,
id:
public_project
,
text:
'*Markdown* text'
post
:preview_markdown
,
namespace_id:
public_project
.
namespace
,
id:
public_project
,
text:
'*Markdown* text'
expect
(
JSON
.
parse
(
response
.
body
).
keys
).
to
match_array
(
%w(body references)
)
expect
(
JSON
.
parse
(
response
.
body
).
keys
).
to
match_array
(
%w(body references)
)
end
end
context
'state filter on references'
do
let
(
:issue
)
{
create
(
:issue
,
:closed
,
project:
public_project
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
:closed
,
target_project:
public_project
)
}
it
'renders JSON body with state filter for issues'
do
post
:preview_markdown
,
namespace_id:
public_project
.
namespace
,
id:
public_project
,
text:
issue
.
to_reference
json_response
=
JSON
.
parse
(
response
.
body
)
expect
(
json_response
[
'body'
]).
to
match
(
/\#
#{
issue
.
iid
}
\(closed\)/
)
end
it
'renders JSON body with state filter for MRs'
do
post
:preview_markdown
,
namespace_id:
public_project
.
namespace
,
id:
public_project
,
text:
merge_request
.
to_reference
json_response
=
JSON
.
parse
(
response
.
body
)
expect
(
json_response
[
'body'
]).
to
match
(
/\!
#{
merge_request
.
iid
}
\(closed\)/
)
end
end
end
end
describe
'#ensure_canonical_path'
do
describe
'#ensure_canonical_path'
do
...
...
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