Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrett Walker <bwalker@gitlab.com>2019-01-30 03:31:31 +0300
committerBrett Walker <bwalker@gitlab.com>2019-02-07 18:28:35 +0300
commit79bd1b8717599205fd1bf4f79048d3065b500536 (patch)
tree5c69bd43f58997d97504cc2063c6064f434ba11f /spec/services/task_list_toggle_service_spec.rb
parentca154f0ff4f15d717a0fcf7a3cb75921ba6880ee (diff)
Enable fast task lists for merge requests
Allow single tasks to be updated quickly
Diffstat (limited to 'spec/services/task_list_toggle_service_spec.rb')
-rw-r--r--spec/services/task_list_toggle_service_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/services/task_list_toggle_service_spec.rb b/spec/services/task_list_toggle_service_spec.rb
index cc64dd25085..7c5480d382f 100644
--- a/spec/services/task_list_toggle_service_spec.rb
+++ b/spec/services/task_list_toggle_service_spec.rb
@@ -67,6 +67,17 @@ describe TaskListToggleService do
expect(toggler.execute).to be_falsey
end
+ it 'tolerates \r\n line endings' do
+ rn_markdown = markdown.gsub("\n", "\r\n")
+ toggler = described_class.new(rn_markdown, markdown_html,
+ toggle_as_checked: true,
+ line_source: '* [ ] Task 1', line_number: 1)
+
+ expect(toggler.execute).to be_truthy
+ expect(toggler.updated_markdown.lines[0]).to eq "* [x] Task 1\r\n"
+ expect(toggler.updated_markdown_html).to include('disabled checked> Task 1')
+ end
+
it 'returns false if markdown is nil' do
toggler = described_class.new(nil, markdown_html,
toggle_as_checked: false,