summaryrefslogtreecommitdiff
path: root/spec/models/project_wiki_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-17 21:06:41 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-17 21:06:41 +0000
commitda35510cdad8f8d3cb6c119682dc2735531983cd (patch)
treed42432c9ddc0d55a3c6316cdb539af11244a148f /spec/models/project_wiki_spec.rb
parent7f82744e89f22bdd2d13f85ca4dc66e088f3da5c (diff)
downloadgitlab-ce-da35510cdad8f8d3cb6c119682dc2735531983cd.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, 18 insertions, 4 deletions
diff --git a/spec/models/project_wiki_spec.rb b/spec/models/project_wiki_spec.rb
index d12dd97bb9e..b089544c810 100644
--- a/spec/models/project_wiki_spec.rb
+++ b/spec/models/project_wiki_spec.rb
@@ -47,11 +47,25 @@ describe ProjectWiki do
describe "#http_url_to_repo" do
let(:project) { create :project }
- it 'returns the full http url to the repo' do
- expected_url = "#{Gitlab.config.gitlab.url}/#{subject.full_path}.git"
+ context 'when a custom HTTP clone URL root is not set' do
+ it 'returns the full http url to the repo' do
+ expected_url = "#{Gitlab.config.gitlab.url}/#{subject.full_path}.git"
- expect(project_wiki.http_url_to_repo).to eq(expected_url)
- expect(project_wiki.http_url_to_repo).not_to include('@')
+ expect(project_wiki.http_url_to_repo).to eq(expected_url)
+ expect(project_wiki.http_url_to_repo).not_to include('@')
+ end
+ end
+
+ context 'when a custom HTTP clone URL root is set' do
+ before do
+ stub_application_setting(custom_http_clone_url_root: 'https://git.example.com:51234')
+ end
+
+ it 'returns the full http url to the repo, with the root replaced with the custom one' do
+ expected_url = "https://git.example.com:51234/#{subject.full_path}.git"
+
+ expect(project_wiki.http_url_to_repo).to eq(expected_url)
+ end
end
end