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
Jérome Perrin
gitlab-ce
Commits
c8f2d18a
Commit
c8f2d18a
authored
Feb 15, 2016
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Does not create a task for new issue when assignee is the current user
parent
422a01fc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
app/services/task_service.rb
app/services/task_service.rb
+1
-1
spec/services/task_service_spec.rb
spec/services/task_service_spec.rb
+4
-0
No files found.
app/services/task_service.rb
View file @
c8f2d18a
...
@@ -11,7 +11,7 @@ class TaskService
...
@@ -11,7 +11,7 @@ class TaskService
# * creates a pending task for assignee if issue is assigned
# * creates a pending task for assignee if issue is assigned
#
#
def
new_issue
(
issue
,
current_user
)
def
new_issue
(
issue
,
current_user
)
if
issue
.
is_assigned?
if
issue
.
is_assigned?
&&
issue
.
assignee
!=
current_user
create_task
(
issue
.
project
,
issue
,
current_user
,
issue
.
assignee
,
Task
::
ASSIGNED
)
create_task
(
issue
.
project
,
issue
,
current_user
,
issue
.
assignee
,
Task
::
ASSIGNED
)
end
end
end
end
...
...
spec/services/task_service_spec.rb
View file @
c8f2d18a
...
@@ -25,6 +25,10 @@ describe TaskService, services: true do
...
@@ -25,6 +25,10 @@ describe TaskService, services: true do
it
'does not create a task if unassigned'
do
it
'does not create a task if unassigned'
do
is_expected_to_not_create_task
{
service
.
new_issue
(
unassigned_issue
,
author
)
}
is_expected_to_not_create_task
{
service
.
new_issue
(
unassigned_issue
,
author
)
}
end
end
it
'does not create a task if assignee is the current user'
do
is_expected_to_not_create_task
{
service
.
new_issue
(
unassigned_issue
,
john_doe
)
}
end
end
end
describe
'#reassigned_issue'
do
describe
'#reassigned_issue'
do
...
...
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