diff options
author | Rémy Coutable <remy@rymai.me> | 2017-05-30 15:11:58 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2017-05-30 15:11:58 +0300 |
commit | fd376b3ed4de310f8e599cbbeb5c18e5a31c188c (patch) | |
tree | 64554869813bc736668d93efc9b863fc28a5b435 /spec | |
parent | c5b0c530bf93e4525f8573dea14abd3f927b0f90 (diff) |
Revert "Merge branch '1937-https-clone-url-username' into 'master'
"
This reverts commit c425f366bfa84efab92b5d5e1d0721f16a2890bc, reversing
changes made to 82f6c0f5ac4ed29390ed90592d2c431f3494d93f.
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/admin/admin_disables_git_access_protocol_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/projects/developer_views_empty_project_instructions_spec.rb | 12 | ||||
-rw-r--r-- | spec/models/project_spec.rb | 16 |
3 files changed, 7 insertions, 23 deletions
diff --git a/spec/features/admin/admin_disables_git_access_protocol_spec.rb b/spec/features/admin/admin_disables_git_access_protocol_spec.rb index 273cacd82cd..e8e080ce3e2 100644 --- a/spec/features/admin/admin_disables_git_access_protocol_spec.rb +++ b/spec/features/admin/admin_disables_git_access_protocol_spec.rb @@ -32,7 +32,7 @@ feature 'Admin disables Git access protocol', feature: true do scenario 'shows only HTTP url' do visit_project - expect(page).to have_content("git clone #{project.http_url_to_repo(admin)}") + expect(page).to have_content("git clone #{project.http_url_to_repo}") expect(page).not_to have_selector('#clone-dropdown') end end diff --git a/spec/features/projects/developer_views_empty_project_instructions_spec.rb b/spec/features/projects/developer_views_empty_project_instructions_spec.rb index 2352329d58c..0c51fe72ca4 100644 --- a/spec/features/projects/developer_views_empty_project_instructions_spec.rb +++ b/spec/features/projects/developer_views_empty_project_instructions_spec.rb @@ -56,14 +56,8 @@ feature 'Developer views empty project instructions', feature: true do end def expect_instructions_for(protocol) - url = - case protocol - when 'ssh' - project.ssh_url_to_repo - when 'http' - project.http_url_to_repo(developer) - end - - expect(page).to have_content("git clone #{url}") + msg = :"#{protocol.downcase}_url_to_repo" + + expect(page).to have_content("git clone #{project.send(msg)}") end end 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 |