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
6691c7a5
Commit
6691c7a5
authored
Jun 24, 2021
by
Alex Kalderimis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move uses of group_wiki factories to EE only
parent
96bd5098
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
66 additions
and
8 deletions
+66
-8
ee/spec/frontend/fixtures/api_markdown.rb
ee/spec/frontend/fixtures/api_markdown.rb
+60
-0
ee/spec/frontend/fixtures/api_markdown.yml
ee/spec/frontend/fixtures/api_markdown.yml
+6
-0
spec/frontend/fixtures/api_markdown.rb
spec/frontend/fixtures/api_markdown.rb
+0
-5
spec/frontend/fixtures/api_markdown.yml
spec/frontend/fixtures/api_markdown.yml
+0
-3
No files found.
ee/spec/frontend/fixtures/api_markdown.rb
0 → 100644
View file @
6691c7a5
# frozen_string_literal: true
require
'spec_helper'
RSpec
.
describe
API
::
MergeRequests
,
'(JavaScript fixtures)'
,
type: :request
do
include
ApiHelpers
include
WikiHelpers
include
JavaScriptFixturesHelpers
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:group
)
{
create
(
:group
,
:public
)
}
let_it_be
(
:group_wiki
)
{
create
(
:group_wiki
,
user:
user
)
}
let
(
:group_wiki_page
)
{
create
(
:wiki_page
,
wiki:
group_wiki
)
}
let
(
:project_wiki_page
)
{
create
(
:wiki_page
,
wiki:
project_wiki
)
}
fixture_subdir
=
'api/markdown'
before
(
:all
)
do
clean_frontend_fixtures
(
fixture_subdir
)
group
.
add_owner
(
user
)
end
before
do
stub_group_wikis
(
true
)
sign_in
(
user
)
end
markdown_examples
=
begin
yaml_file_path
=
File
.
expand_path
(
'api_markdown.yml'
,
__dir__
)
yaml
=
File
.
read
(
yaml_file_path
)
YAML
.
safe_load
(
yaml
,
symbolize_names:
true
)
end
markdown_examples
.
each
do
|
markdown_example
|
context
=
markdown_example
.
fetch
(
:context
,
''
)
name
=
markdown_example
.
fetch
(
:name
)
context
"for
#{
name
}#{
!
context
.
empty?
?
" (context:
#{
context
}
)"
:
''
}
"
do
let
(
:markdown
)
{
markdown_example
.
fetch
(
:markdown
)
}
name
=
"
#{
context
}
_
#{
name
}
"
unless
context
.
empty?
it
"
#{
fixture_subdir
}
/
#{
name
}
.json"
do
api_url
=
case
context
when
'group_wiki'
"/groups/
#{
group
.
full_path
}
/-/wikis/
#{
group_wiki_page
.
slug
}
/preview_markdown"
else
api
"/markdown"
end
post
api_url
,
params:
{
text:
markdown
,
gfm:
true
}
expect
(
response
).
to
be_successful
end
end
end
end
ee/spec/frontend/fixtures/api_markdown.yml
0 → 100644
View file @
6691c7a5
# This data file drives the specs in
# ee/spec/frontend/fixtures/api_markdown.rb and
---
-
name
:
attachment_link
context
:
group_wiki
markdown
:
'
[test-file](test-file.zip)'
spec/frontend/fixtures/api_markdown.rb
View file @
6691c7a5
...
...
@@ -12,10 +12,8 @@ RSpec.describe API::MergeRequests, '(JavaScript fixtures)', type: :request do
let_it_be
(
:group
)
{
create
(
:group
,
:public
)
}
let_it_be
(
:project
)
{
create
(
:project
,
:public
,
:repository
,
group:
group
)
}
let_it_be
(
:group_wiki
)
{
create
(
:group_wiki
,
user:
user
)
}
let_it_be
(
:project_wiki
)
{
create
(
:project_wiki
,
user:
user
)
}
let
(
:group_wiki_page
)
{
create
(
:wiki_page
,
wiki:
group_wiki
)
}
let
(
:project_wiki_page
)
{
create
(
:wiki_page
,
wiki:
project_wiki
)
}
fixture_subdir
=
'api/markdown'
...
...
@@ -28,7 +26,6 @@ RSpec.describe API::MergeRequests, '(JavaScript fixtures)', type: :request do
end
before
do
stub_group_wikis
(
true
)
sign_in
(
user
)
end
...
...
@@ -55,8 +52,6 @@ RSpec.describe API::MergeRequests, '(JavaScript fixtures)', type: :request do
"/groups/
#{
group
.
full_path
}
/preview_markdown"
when
'project_wiki'
"/
#{
project
.
full_path
}
/-/wikis/
#{
project_wiki_page
.
slug
}
/preview_markdown"
when
'group_wiki'
"/groups/
#{
group
.
full_path
}
/-/wikis/
#{
group_wiki_page
.
slug
}
/preview_markdown"
else
api
"/markdown"
end
...
...
spec/frontend/fixtures/api_markdown.yml
View file @
6691c7a5
...
...
@@ -20,9 +20,6 @@
-
name
:
attachment_link
context
:
project
markdown
:
'
[test-file](/uploads/aa45a38ec2cfe97433281b10bbff042c/test-file.zip)'
-
name
:
attachment_link
context
:
group_wiki
markdown
:
'
[test-file](test-file.zip)'
-
name
:
attachment_link
context
:
group
markdown
:
'
[test-file](/uploads/aa45a38ec2cfe97433281b10bbff042c/test-file.zip)'
...
...
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