summaryrefslogtreecommitdiff
path: root/spec/models/project_wiki_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-23 03:06:01 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-23 03:06:01 +0000
commit8c7eab92cd0009f55cb999bbade43e0f969c137e (patch)
tree180cac6632448a211ddbe555191574c98e8dc385 /spec/models/project_wiki_spec.rb
parentdffeff5520e861dc6e7319b690c573186bbbd22e (diff)
downloadgitlab-ce-8c7eab92cd0009f55cb999bbade43e0f969c137e.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/project_wiki_spec.rb')
-rw-r--r--spec/models/project_wiki_spec.rb22
1 files changed, 19 insertions, 3 deletions
diff --git a/spec/models/project_wiki_spec.rb b/spec/models/project_wiki_spec.rb
index 31d1d1fd7d1..f5c827e5a29 100644
--- a/spec/models/project_wiki_spec.rb
+++ b/spec/models/project_wiki_spec.rb
@@ -28,7 +28,9 @@ describe ProjectWiki do
describe '#web_url' do
it 'returns the full web URL to the wiki' do
- expect(subject.web_url).to eq("#{Gitlab.config.gitlab.url}/#{project.full_path}/wikis/home")
+ home_url = Gitlab::Routing.url_helpers.project_wiki_url(project, :home)
+
+ expect(subject.web_url).to eq(home_url)
end
end
@@ -71,9 +73,23 @@ describe ProjectWiki do
describe "#wiki_base_path" do
it "returns the wiki base path" do
- wiki_base_path = "#{Gitlab.config.gitlab.relative_url_root}/#{project.full_path}/wikis"
+ wiki_path = Gitlab::Routing.url_helpers.project_wikis_path(project)
+
+ expect(subject.wiki_base_path).to eq(wiki_path)
+ end
+ end
- expect(subject.wiki_base_path).to eq(wiki_base_path)
+ describe "#wiki_page_path" do
+ let(:page) { create(:wiki_page, wiki: project_wiki) }
+
+ describe 'suffixed with /:page_slug' do
+ subject { "#{project_wiki.wiki_page_path}/#{page.slug}" }
+
+ it "equals the project_wiki_path" do
+ path = Gitlab::Routing.url_helpers.project_wiki_path(project, page)
+
+ expect(subject).to eq(path)
+ end
end
end