Commit 4e40d72a authored by Brett Walker's avatar Brett Walker Committed by Fatih Acet

Added changelog and danger fixes

parent dfeb412d
---
title: Increase reliability and performance of clicking task items
merge_request: 23938
author:
type: fixed
...@@ -552,7 +552,7 @@ describe Issues::UpdateService, :mailer do ...@@ -552,7 +552,7 @@ describe Issues::UpdateService, :mailer do
context 'when a task is marked as completed' do context 'when a task is marked as completed' do
before do before do
update_issue(update_task: { index: 1, checked: true, line_source: '- [ ] Task 1', line_number: 1}) update_issue(update_task: { index: 1, checked: true, line_source: '- [ ] Task 1', line_number: 1 })
end end
it 'creates system note about task status change' do it 'creates system note about task status change' do
...@@ -568,7 +568,7 @@ describe Issues::UpdateService, :mailer do ...@@ -568,7 +568,7 @@ describe Issues::UpdateService, :mailer do
context 'when a task is marked as incomplete' do context 'when a task is marked as incomplete' do
before do before do
update_issue(description: "- [x] Task 1\n- [X] Task 2") update_issue(description: "- [x] Task 1\n- [X] Task 2")
update_issue(update_task: { index: 2, checked: false, line_source: '- [X] Task 2', line_number: 2}) update_issue(update_task: { index: 2, checked: false, line_source: '- [X] Task 2', line_number: 2 })
end end
it 'creates system note about task status change' do it 'creates system note about task status change' do
...@@ -589,7 +589,7 @@ describe Issues::UpdateService, :mailer do ...@@ -589,7 +589,7 @@ describe Issues::UpdateService, :mailer do
it 'raises an exception' do it 'raises an exception' do
expect(Note.count).to eq(2) expect(Note.count).to eq(2)
expect do expect do
update_issue(update_task: { index: 2, checked: true, line_source: '- [ ] Task 2', line_number: 2}) update_issue(update_task: { index: 2, checked: true, line_source: '- [ ] Task 2', line_number: 2 })
end.to raise_error(ActiveRecord::StaleObjectError) end.to raise_error(ActiveRecord::StaleObjectError)
expect(Note.count).to eq(2) expect(Note.count).to eq(2)
end end
...@@ -599,7 +599,7 @@ describe Issues::UpdateService, :mailer do ...@@ -599,7 +599,7 @@ describe Issues::UpdateService, :mailer do
before do before do
update_issue(description: "Paragraph\n\n- [ ] Task 1\n- [x] Task 2") update_issue(description: "Paragraph\n\n- [ ] Task 1\n- [x] Task 2")
update_issue(description: "Paragraph with more words\n\n- [ ] Task 1\n- [x] Task 2") update_issue(description: "Paragraph with more words\n\n- [ ] Task 1\n- [x] Task 2")
update_issue(update_task: { index: 2, checked: false, line_source: '- [x] Task 2', line_number: 4}) update_issue(update_task: { index: 2, checked: false, line_source: '- [x] Task 2', line_number: 4 })
end end
it 'creates system note about task status change' do it 'creates system note about task status change' do
......
# frozen_string_literal: true
require 'spec_helper' require 'spec_helper'
describe TaskListToggleService do describe TaskListToggleService do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment