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
29bed42f
Commit
29bed42f
authored
Dec 26, 2018
by
Mark Lapierre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create group via factory class
parent
49410a8c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
18 deletions
+1
-18
qa/qa/specs/features/api/2_plan/ee_epics_milestone_dates_spec.rb
...pecs/features/api/2_plan/ee_epics_milestone_dates_spec.rb
+1
-18
No files found.
qa/qa/specs/features/api/2_plan/ee_epics_milestone_dates_spec.rb
View file @
29bed42f
...
...
@@ -5,7 +5,7 @@ module QA
describe
'Epics milestone dates API'
do
before
(
:context
)
do
@api_client
=
Runtime
::
API
::
Client
.
new
(
:gitlab
)
@group_id
=
create_group
@group_id
=
Resource
::
Group
.
fabricate_via_api!
.
id
@project_id
=
create_project
@milestone_start_date
=
(
Date
.
today
.
to_date
+
100
).
strftime
(
"%Y-%m-%d"
)
@milestone_due_date
=
(
Date
.
today
.
to_date
+
120
).
strftime
(
"%Y-%m-%d"
)
...
...
@@ -26,23 +26,6 @@ module QA
Runtime
::
API
::
Request
.
new
(
@api_client
,
api_endpoint
)
end
def
create_group
(
is_sandbox_group
=
false
)
group_name
=
is_sandbox_group
?
Runtime
::
Namespace
.
sandbox_name
:
"group_
#{
SecureRandom
.
hex
(
8
)
}
"
parent_id
=
is_sandbox_group
?
nil
:
sandbox_group_id
create_group_request
=
create_request
(
"/groups"
)
post
create_group_request
.
url
,
name:
group_name
,
path:
group_name
,
parent_id:
parent_id
,
visibility:
'public'
expect_status
(
201
)
json_body
[
:id
]
end
def
sandbox_group_id
@_sandbox_group_id
||=
begin
request
=
create_request
(
"/groups/
#{
Runtime
::
Namespace
.
sandbox_name
}
"
)
get
request
.
url
json_body
[
:id
]
?
json_body
[
:id
]
:
create_group
(
true
)
end
end
def
create_project
project_name
=
"project_
#{
SecureRandom
.
hex
(
8
)
}
"
create_project_request
=
create_request
(
'/projects'
)
...
...
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