BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
3aabed34
Commit
3aabed34
authored
Nov 20, 2015
by
Rubén Dávila
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug that happened when replacing the Task list. #2296
REF:
https://gitlab.com/gitlab-org/gitlab-ce/issues/2296#note_2724697
parent
fa9f2dec
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletion
+20
-1
taskable.rb
app/models/concerns/taskable.rb
+1
-1
update_service_spec.rb
spec/services/issues/update_service_spec.rb
+19
-0
No files found.
app/models/concerns/taskable.rb
View file @
3aabed34
...
...
@@ -31,7 +31,7 @@ module Taskable
old_task
=
old_tasks
[
i
]
next
unless
old_task
new_task
.
source
==
new
_task
.
source
&&
new_task
.
complete?
!=
old_task
.
complete?
new_task
.
source
==
old
_task
.
source
&&
new_task
.
complete?
!=
old_task
.
complete?
end
end
...
...
spec/services/issues/update_service_spec.rb
View file @
3aabed34
...
...
@@ -121,6 +121,25 @@ describe Issues::UpdateService do
expect
(
note
).
to
be_nil
end
end
context
'when a Task list with a completed item is totally replaced'
do
before
do
update_issue
({
description:
"- [ ] Task 1
\n
- [X] Task 2"
})
update_issue
({
description:
"- [ ] One
\n
- [ ] Two
\n
- [ ] Three"
})
end
it
'does not create a system note referencing the position the old item'
do
note
=
find_note
(
'Marked the task **Two** as incomplete'
)
expect
(
note
).
to
be_nil
end
it
'should not generate a new note at all'
do
expect
{
update_issue
({
description:
"- [ ] One
\n
- [ ] Two
\n
- [ ] Three"
})
}.
not_to
change
{
Note
.
count
}
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