Commit 15976edf authored by Ash McKenzie's avatar Ash McKenzie

Use helpers where possible

parent 0414226f
...@@ -26,10 +26,12 @@ describe Gitlab::Geo::GitPushSSHProxy, :geo do ...@@ -26,10 +26,12 @@ describe Gitlab::Geo::GitPushSSHProxy, :geo do
} }
end end
let(:primary_repo_http) { geo_primary_http_url_to_repo(project) }
let(:data) do let(:data) do
{ {
'gl_id' => "key-#{key.id}", 'gl_id' => "key-#{key.id}",
'primary_repo' => "#{primary_node.url}#{project.repository.full_path}.git" 'primary_repo' => primary_repo_http
} }
end end
...@@ -56,7 +58,7 @@ describe Gitlab::Geo::GitPushSSHProxy, :geo do ...@@ -56,7 +58,7 @@ describe Gitlab::Geo::GitPushSSHProxy, :geo do
context 'against secondary node' do context 'against secondary node' do
let(:current_node) { secondary_node } let(:current_node) { secondary_node }
let(:full_info_refs_url) { "#{primary_node.url}#{project.full_path}.git/info/refs?service=git-receive-pack" } let(:full_info_refs_url) { "#{primary_repo_http}/info/refs?service=git-receive-pack" }
let(:info_refs_headers) { base_headers.merge('Content-Type' => 'application/x-git-upload-pack-request') } let(:info_refs_headers) { base_headers.merge('Content-Type' => 'application/x-git-upload-pack-request') }
let(:info_refs_http_body_full) do let(:info_refs_http_body_full) do
"001f# service=git-receive-pack "001f# service=git-receive-pack
...@@ -91,7 +93,7 @@ describe Gitlab::Geo::GitPushSSHProxy, :geo do ...@@ -91,7 +93,7 @@ describe Gitlab::Geo::GitPushSSHProxy, :geo do
context 'against secondary node' do context 'against secondary node' do
let(:current_node) { secondary_node } let(:current_node) { secondary_node }
let(:full_git_receive_pack_url) { "#{primary_node.url}#{project.full_path}.git/git-receive-pack" } let(:full_git_receive_pack_url) { "#{primary_repo_http}/git-receive-pack" }
let(:push_headers) do let(:push_headers) do
base_headers.merge( base_headers.merge(
'Content-Type' => 'application/x-git-receive-pack-request', 'Content-Type' => 'application/x-git-receive-pack-request',
......
...@@ -2,7 +2,7 @@ require 'spec_helper' ...@@ -2,7 +2,7 @@ require 'spec_helper'
describe Gitlab::GitAccessWiki do describe Gitlab::GitAccessWiki do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :repository) } let(:project) { create(:project, :wiki_repo) }
let(:changes) { ['6f6d7e7ed 570e7b2ab refs/heads/master'] } let(:changes) { ['6f6d7e7ed 570e7b2ab refs/heads/master'] }
let(:authentication_abilities) { %i[read_project download_code push_code] } let(:authentication_abilities) { %i[read_project download_code push_code] }
let(:redirected_path) { nil } let(:redirected_path) { nil }
...@@ -17,7 +17,7 @@ describe Gitlab::GitAccessWiki do ...@@ -17,7 +17,7 @@ describe Gitlab::GitAccessWiki do
allow(Gitlab::Database).to receive(:read_only?) { true } allow(Gitlab::Database).to receive(:read_only?) { true }
end end
let(:primary_repo_url) { "https://localhost:3000/gitlab/#{project.full_path}.wiki.git" } let(:primary_repo_url) { geo_primary_http_url_to_repo(project.wiki) }
it_behaves_like 'a read-only GitLab instance' it_behaves_like 'a read-only GitLab instance'
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment