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
28818864
Commit
28818864
authored
Aug 01, 2018
by
Peter Leitzen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cannot mark a Commit as todo via `/todo`
parent
56ce4667
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
11 deletions
+24
-11
app/services/quick_actions/interpret_service.rb
app/services/quick_actions/interpret_service.rb
+2
-1
spec/services/quick_actions/interpret_service_spec.rb
spec/services/quick_actions/interpret_service_spec.rb
+22
-10
No files found.
app/services/quick_actions/interpret_service.rb
View file @
28818864
...
...
@@ -301,6 +301,7 @@ module QuickActions
desc
'Add a todo'
explanation
'Adds a todo.'
condition
do
issuable
.
is_a?
(
Issuable
)
&&
issuable
.
persisted?
&&
!
TodoService
.
new
.
todo_exist?
(
issuable
,
current_user
)
end
...
...
spec/services/quick_actions/interpret_service_spec.rb
View file @
28818864
...
...
@@ -637,16 +637,6 @@ describe QuickActions::InterpretService do
let
(
:issuable
)
{
merge_request
}
end
it_behaves_like
'todo command'
do
let
(
:content
)
{
'/todo'
}
let
(
:issuable
)
{
issue
}
end
it_behaves_like
'todo command'
do
let
(
:content
)
{
'/todo'
}
let
(
:issuable
)
{
merge_request
}
end
it_behaves_like
'done command'
do
let
(
:content
)
{
'/done'
}
let
(
:issuable
)
{
issue
}
...
...
@@ -796,6 +786,28 @@ describe QuickActions::InterpretService do
let
(
:issuable
)
{
issue
}
end
context
'/todo'
do
let
(
:content
)
{
'/todo'
}
context
'if issuable is an Issue'
do
it_behaves_like
'todo command'
do
let
(
:issuable
)
{
issue
}
end
end
context
'if issuable is a MergeRequest'
do
it_behaves_like
'todo command'
do
let
(
:issuable
)
{
merge_request
}
end
end
context
'if issuable is a Commit'
do
it_behaves_like
'empty command'
do
let
(
:issuable
)
{
commit
}
end
end
end
context
'/copy_metadata command'
do
let
(
:todo_label
)
{
create
(
:label
,
project:
project
,
title:
'To Do'
)
}
let
(
:inreview_label
)
{
create
(
:label
,
project:
project
,
title:
'In Review'
)
}
...
...
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