diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
commit | 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch) | |
tree | a77e7fe7a93de11213032ed4ab1f33a3db51b738 /spec/lib/gitlab/url_builder_spec.rb | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'spec/lib/gitlab/url_builder_spec.rb')
-rw-r--r-- | spec/lib/gitlab/url_builder_spec.rb | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/spec/lib/gitlab/url_builder_spec.rb b/spec/lib/gitlab/url_builder_spec.rb index 66826bcb3b1..e91d17bfbe8 100644 --- a/spec/lib/gitlab/url_builder_spec.rb +++ b/spec/lib/gitlab/url_builder_spec.rb @@ -96,6 +96,38 @@ describe Gitlab::UrlBuilder do end end + context 'when passing a Wiki' do + let(:wiki) { build_stubbed(:project_wiki) } + + describe '#wiki_url' do + it 'uses the default collection action' do + url = subject.wiki_url(wiki) + + expect(url).to eq "#{Gitlab.config.gitlab.url}/#{wiki.project.full_path}/-/wikis/home" + end + + it 'supports a custom collection action' do + url = subject.wiki_url(wiki, action: :pages) + + expect(url).to eq "#{Gitlab.config.gitlab.url}/#{wiki.project.full_path}/-/wikis/pages" + end + end + + describe '#wiki_page_url' do + it 'uses the default member action' do + url = subject.wiki_page_url(wiki, 'foo') + + expect(url).to eq "#{Gitlab.config.gitlab.url}/#{wiki.project.full_path}/-/wikis/foo" + end + + it 'supports a custom member action' do + url = subject.wiki_page_url(wiki, 'foo', action: :edit) + + expect(url).to eq "#{Gitlab.config.gitlab.url}/#{wiki.project.full_path}/-/wikis/foo/edit" + end + end + end + context 'when passing a DesignManagement::Design' do let(:design) { build_stubbed(:design) } |