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
59d7ffad
Commit
59d7ffad
authored
Aug 11, 2017
by
haseeb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests for inheriting milestones and labels
parent
a115267e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
1 deletion
+26
-1
spec/services/merge_requests/create_from_issue_service_spec.rb
...services/merge_requests/create_from_issue_service_spec.rb
+26
-1
No files found.
spec/services/merge_requests/create_from_issue_service_spec.rb
View file @
59d7ffad
...
...
@@ -4,8 +4,21 @@ describe MergeRequests::CreateFromIssueService do
let
(
:project
)
{
create
(
:project
,
:repository
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let
(
:milestone
)
{
create
(
:milestone
,
project:
project
)
}
let
(
:labels
)
{
create_pair
(
:label
,
project:
project
)
}
subject
(
:service
)
{
described_class
.
new
(
project
,
user
,
issue_iid:
issue
.
iid
)
}
subject
(
:service2
)
do
described_class
.
new
(
project
,
user
,
{
issue_iid:
issue
.
iid
,
milestone_id:
milestone
.
id
,
label_ids:
labels
.
map
(
&
:id
)
}
)
end
before
do
project
.
add_developer
(
user
)
...
...
@@ -25,6 +38,18 @@ describe MergeRequests::CreateFromIssueService do
described_class
.
new
(
project
,
user
,
issue_iid:
-
1
).
execute
end
it
"can inherit labels"
do
result
=
service2
.
execute
expect
(
result
[
:merge_request
].
label_ids
).
to
eq
(
labels
.
map
(
&
:id
))
end
it
"can inherit milestones"
do
result
=
service2
.
execute
expect
(
result
[
:merge_request
].
milestone_id
).
to
eq
(
milestone
.
id
)
end
it
'delegates the branch creation to CreateBranchService'
do
expect_any_instance_of
(
CreateBranchService
).
to
receive
(
:execute
).
once
.
and_call_original
...
...
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