diff options
author | Douwe Maan <douwe@gitlab.com> | 2017-05-30 21:47:55 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2017-05-30 21:47:55 +0300 |
commit | 8039b9c3c6caedc19e0e44d086a007e8975134b7 (patch) | |
tree | 859d1a25b2bbb17920315482a8ef4d85369fb936 /spec/models | |
parent | c5e26e57282f8e9423c9281196e4bf317887d68e (diff) | |
parent | 08134ad2909c4497dc5ef0e4b144ccc6330a9de8 (diff) |
Merge branch '30410-revert-9347-and-10079' into 'master'
Resolve "Allow to disable username on checkout url"
Closes #30410 and #30174
See merge request !11792
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/project_spec.rb | 16 | ||||
-rw-r--r-- | spec/models/project_wiki_spec.rb | 18 |
2 files changed, 7 insertions, 27 deletions
diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 36575acf671..2ef3d5654d5 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -1909,19 +1909,9 @@ describe Project, models: true do describe '#http_url_to_repo' do let(:project) { create :empty_project } - context 'when no user is given' do - it 'returns the url to the repo without a username' do - expect(project.http_url_to_repo).to eq("#{project.web_url}.git") - expect(project.http_url_to_repo).not_to include('@') - end - end - - context 'when user is given' do - it 'returns the url to the repo with the username' do - user = build_stubbed(:user) - - expect(project.http_url_to_repo(user)).to start_with("http://#{user.username}@") - end + it 'returns the url to the repo without a username' do + expect(project.http_url_to_repo).to eq("#{project.web_url}.git") + expect(project.http_url_to_repo).not_to include('@') end end diff --git a/spec/models/project_wiki_spec.rb b/spec/models/project_wiki_spec.rb index 969e9f7a130..224067f58dd 100644 --- a/spec/models/project_wiki_spec.rb +++ b/spec/models/project_wiki_spec.rb @@ -37,21 +37,11 @@ describe ProjectWiki, models: true do describe "#http_url_to_repo" do let(:project) { create :empty_project } - context 'when no user is given' do - it 'returns the url to the repo without a username' do - expected_url = "#{Gitlab.config.gitlab.url}/#{subject.path_with_namespace}.git" + it 'returns the full http url to the repo' do + expected_url = "#{Gitlab.config.gitlab.url}/#{subject.path_with_namespace}.git" - 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 user is given' do - it 'returns the url to the repo with the username' do - user = build_stubbed(:user) - - expect(project_wiki.http_url_to_repo(user)).to start_with("http://#{user.username}@") - end + expect(project_wiki.http_url_to_repo).to eq(expected_url) + expect(project_wiki.http_url_to_repo).not_to include('@') end end |