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.rb11
1 files changed, 10 insertions, 1 deletions
diff --git a/spec/models/wiki_page_spec.rb b/spec/models/wiki_page_spec.rb
index 201dc85daf8..8f2da8ff9a1 100644
--- a/spec/models/wiki_page_spec.rb
+++ b/spec/models/wiki_page_spec.rb
@@ -651,6 +651,7 @@ describe WikiPage do
let(:untitled_page) { described_class.new(wiki) }
let(:directory_page) { create(:wiki_page, title: 'parent directory/child page') }
+ let(:page_with_special_characters) { create(:wiki_page, title: 'test+page') }
where(:page, :title, :changed) do
:untitled_page | nil | false
@@ -658,6 +659,8 @@ describe WikiPage do
:new_page | nil | true
:new_page | 'test page' | true
+ :new_page | 'test-page' | true
+ :new_page | 'test+page' | true
:new_page | 'new title' | true
:existing_page | nil | false
@@ -665,6 +668,7 @@ describe WikiPage do
:existing_page | 'test-page' | false
:existing_page | '/test page' | false
:existing_page | '/test-page' | false
+ :existing_page | 'test+page' | true
:existing_page | ' test page ' | true
:existing_page | 'new title' | true
:existing_page | 'new-title' | true
@@ -681,6 +685,11 @@ describe WikiPage do
:directory_page | 'parent-directory / child-page' | true
:directory_page | 'other directory/child page' | true
:directory_page | 'other-directory/child page' | true
+
+ :page_with_special_characters | nil | false
+ :page_with_special_characters | 'test+page' | false
+ :page_with_special_characters | 'test-page' | true
+ :page_with_special_characters | 'test page' | true
end
with_them do
@@ -772,7 +781,7 @@ describe WikiPage do
describe '#to_partial_path' do
it 'returns the relative path to the partial to be used' do
- expect(subject.to_partial_path).to eq('projects/wikis/wiki_page')
+ expect(subject.to_partial_path).to eq('../shared/wikis/wiki_page')
end
end