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
3e941b13
Commit
3e941b13
authored
Oct 23, 2016
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add spec in Issues::MoveService to fix label assignment regression
parent
ddafea06
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
5 deletions
+26
-5
spec/services/issues/move_service_spec.rb
spec/services/issues/move_service_spec.rb
+26
-5
No files found.
spec/services/issues/move_service_spec.rb
View file @
3e941b13
...
...
@@ -23,15 +23,16 @@ describe Issues::MoveService, services: true do
old_project
.
team
<<
[
user
,
:reporter
]
new_project
.
team
<<
[
user
,
:reporter
]
[
'label1'
,
'label2'
].
each
do
|
label
|
labels
=
2
.
times
.
map
{
|
x
|
"label%d"
%
(
x
+
1
)
}
labels
.
each
do
|
label
|
old_issue
.
labels
<<
create
(
:label
,
project_id:
old_project
.
id
,
title:
label
)
end
new_project
.
labels
<<
create
(
:label
,
title:
'label1'
)
new_project
.
labels
<<
create
(
:label
,
title:
'label2'
)
end
new_project
.
labels
<<
create
(
:label
,
title:
label
)
end
end
end
describe
'#execute'
do
...
...
@@ -277,5 +278,25 @@ describe Issues::MoveService, services: true do
it
{
expect
{
move
}.
to
raise_error
(
StandardError
,
/permissions/
)
}
end
end
context
'movable issue with no assigned labels'
do
before
do
old_project
.
team
<<
[
user
,
:reporter
]
new_project
.
team
<<
[
user
,
:reporter
]
labels
=
2
.
times
.
map
{
|
x
|
"label%d"
%
(
x
+
1
)
}
labels
.
each
do
|
label
|
new_project
.
labels
<<
create
(
:label
,
title:
label
)
end
end
include_context
'issue move executed'
it
'does not assign labels to new issue'
do
expected_label_titles
=
new_issue
.
reload
.
labels
.
map
(
&
:title
)
expect
(
expected_label_titles
.
size
).
to
eq
0
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