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
d067bdec
Commit
d067bdec
authored
Jun 24, 2020
by
Desiree Chevalier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add assign group milestone spec
Adds a spec for assigning a group milestone
parent
b237f836
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
125 additions
and
58 deletions
+125
-58
qa/qa.rb
qa/qa.rb
+1
-0
qa/qa/resource/group_milestone.rb
qa/qa/resource/group_milestone.rb
+39
-0
qa/qa/specs/features/browser_ui/2_plan/milestone/assign_milestone_spec.rb
...ures/browser_ui/2_plan/milestone/assign_milestone_spec.rb
+85
-0
qa/qa/specs/features/browser_ui/2_plan/milestone/assign_project_milestone_spec.rb
...wser_ui/2_plan/milestone/assign_project_milestone_spec.rb
+0
-58
No files found.
qa/qa.rb
View file @
d067bdec
...
...
@@ -79,6 +79,7 @@ module QA
autoload
:PersonalAccessToken
,
'qa/resource/personal_access_token'
autoload
:User
,
'qa/resource/user'
autoload
:ProjectMilestone
,
'qa/resource/project_milestone'
autoload
:GroupMilestone
,
'qa/resource/group_milestone'
autoload
:Members
,
'qa/resource/members'
autoload
:File
,
'qa/resource/file'
autoload
:Fork
,
'qa/resource/fork'
...
...
qa/qa/resource/group_milestone.rb
0 → 100644
View file @
d067bdec
# frozen_string_literal: true
module
QA
module
Resource
class
GroupMilestone
<
Base
attr_writer
:start_date
,
:due_date
attribute
:id
attribute
:title
attribute
:group
do
Group
.
fabricate_via_api!
do
|
resource
|
resource
.
name
=
'group-with-milestone'
end
end
def
initialize
@title
=
"group-milestone-
#{
SecureRandom
.
hex
(
4
)
}
"
end
def
api_get_path
"/groups/
#{
group
.
id
}
/milestones/
#{
id
}
"
end
def
api_post_path
"/groups/
#{
group
.
id
}
/milestones"
end
def
api_post_body
{
title:
title
}.
tap
do
|
hash
|
hash
[
:start_date
]
=
@start_date
if
@start_date
hash
[
:due_date
]
=
@due_date
if
@due_date
end
end
end
end
end
qa/qa/specs/features/browser_ui/2_plan/milestone/assign_milestone_spec.rb
0 → 100644
View file @
d067bdec
# frozen_string_literal: true
module
QA
context
'Plan'
do
describe
'Milestones'
do
include
Support
::
Dates
let
(
:start_date
)
{
current_date_yyyy_mm_dd
}
let
(
:due_date
)
{
next_month_yyyy_mm_dd
}
let
(
:group
)
do
Resource
::
Group
.
fabricate_via_api!
do
|
group
|
group
.
name
=
'group-to-test-milestones'
end
end
let
(
:project
)
do
Resource
::
Project
.
fabricate_via_api!
do
|
project
|
project
.
name
=
'project-to-test-milestones'
end
end
let
(
:issue
)
do
Resource
::
Issue
.
fabricate_via_api!
do
|
issue
|
issue
.
project
=
project
end
end
before
do
Flow
::
Login
.
sign_in
end
shared_examples
'milestone assigned to existing issue'
do
it
'is assigned to an existing issue'
do
issue
.
visit!
Page
::
Project
::
Issue
::
Show
.
perform
do
|
existing_issue
|
existing_issue
.
assign_milestone
(
milestone
)
expect
(
existing_issue
).
to
have_milestone
(
milestone
.
title
)
end
end
end
shared_examples
'milestone assigned to new issue'
do
it
'is assigned to a new issue'
do
Resource
::
Issue
.
fabricate_via_browser_ui!
do
|
new_issue
|
new_issue
.
project
=
project
new_issue
.
milestone
=
milestone
end
Page
::
Project
::
Issue
::
Show
.
perform
do
|
issue
|
expect
(
issue
).
to
have_milestone
(
milestone
.
title
)
end
end
end
context
'Group milestone'
do
let
(
:milestone
)
do
Resource
::
GroupMilestone
.
fabricate_via_api!
do
|
milestone
|
milestone
.
group
=
group
milestone
.
start_date
=
start_date
milestone
.
due_date
=
due_date
end
end
it_behaves_like
'milestone assigned to existing issue'
it_behaves_like
'milestone assigned to new issue'
end
context
'Project milestone'
do
let
(
:milestone
)
do
Resource
::
ProjectMilestone
.
fabricate_via_api!
do
|
milestone
|
milestone
.
project
=
project
milestone
.
start_date
=
start_date
milestone
.
due_date
=
due_date
end
end
it_behaves_like
'milestone assigned to existing issue'
it_behaves_like
'milestone assigned to new issue'
end
end
end
end
qa/qa/specs/features/browser_ui/2_plan/milestone/assign_project_milestone_spec.rb
deleted
100644 → 0
View file @
b237f836
# frozen_string_literal: true
module
QA
context
'Plan'
do
describe
'Project milestone'
do
include
Support
::
Dates
let
(
:title
)
{
'Project milestone'
}
let
(
:start_date
)
{
current_date_yyyy_mm_dd
}
let
(
:due_date
)
{
next_month_yyyy_mm_dd
}
let
(
:project
)
do
Resource
::
Project
.
fabricate_via_api!
do
|
project
|
project
.
name
=
'project-to-test-milestones'
end
end
let
(
:issue
)
do
Resource
::
Issue
.
fabricate_via_api!
do
|
issue
|
issue
.
project
=
project
end
end
let
(
:project_milestone
)
do
Resource
::
ProjectMilestone
.
fabricate_via_api!
do
|
milestone
|
milestone
.
project
=
project
milestone
.
start_date
=
start_date
milestone
.
due_date
=
due_date
end
end
before
do
Flow
::
Login
.
sign_in
end
it
'assigns a project milestone to an existing issue'
do
issue
.
visit!
Page
::
Project
::
Issue
::
Show
.
perform
do
|
existing_issue
|
existing_issue
.
assign_milestone
(
project_milestone
)
expect
(
existing_issue
).
to
have_milestone
(
project_milestone
.
title
)
end
end
it
'assigns a project milestone to a new issue'
do
Resource
::
Issue
.
fabricate_via_browser_ui!
do
|
issue
|
issue
.
project
=
project
issue
.
milestone
=
project_milestone
end
Page
::
Project
::
Issue
::
Show
.
perform
do
|
issue
|
expect
(
issue
).
to
have_milestone
(
project_milestone
.
title
)
end
end
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