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:
Diffstat (limited to 'spec/models/wiki_page_spec.rb')
-rw-r--r--spec/models/wiki_page_spec.rb12
1 files changed, 10 insertions, 2 deletions
diff --git a/spec/models/wiki_page_spec.rb b/spec/models/wiki_page_spec.rb
index c626f98f874..ee61f191f05 100644
--- a/spec/models/wiki_page_spec.rb
+++ b/spec/models/wiki_page_spec.rb
@@ -2,7 +2,7 @@
require "spec_helper"
-RSpec.describe WikiPage do
+RSpec.describe WikiPage, feature_category: :wiki do
let(:user) { create(:user) }
let(:container) { create(:project) }
let(:wiki) { container.wiki }
@@ -830,13 +830,21 @@ RSpec.describe WikiPage do
expect(subject.content_changed?).to be(true)
end
- it 'returns false if only the newline format has changed' do
+ it 'returns false if only the newline format has changed from LF to CRLF' do
expect(subject.page).to receive(:text_data).and_return("foo\nbar")
subject.attributes[:content] = "foo\r\nbar"
expect(subject.content_changed?).to be(false)
end
+
+ it 'returns false if only the newline format has changed from CRLF to LF' do
+ expect(subject.page).to receive(:text_data).and_return("foo\r\nbar")
+
+ subject.attributes[:content] = "foo\nbar"
+
+ expect(subject.content_changed?).to be(false)
+ end
end
end