Commit 3950599e authored by Valery Sizov's avatar Valery Sizov

Geo: Improve formatting of can't push to secondary warning message

parent 94220238
...@@ -18,7 +18,7 @@ module EE ...@@ -18,7 +18,7 @@ module EE
message = super message = super
if ::Gitlab::Geo.secondary_with_primary? if ::Gitlab::Geo.secondary_with_primary?
message += " Please use the Primary node URL: #{geo_primary_url_to_repo}. Documentation: #{GEO_SERVER_DOCS_URL}" message += "\nPlease use the primary node URL instead: #{geo_primary_url_to_repo}.\nFor more information: #{GEO_SERVER_DOCS_URL}"
end end
message message
......
...@@ -25,8 +25,9 @@ describe Gitlab::GitAccess do ...@@ -25,8 +25,9 @@ describe Gitlab::GitAccess do
end end
it 'denies push access with primary present' do it 'denies push access with primary present' do
error_message = "You can't push code to a read-only GitLab instance. "\ error_message = "You can't push code to a read-only GitLab instance."\
"Please use the Primary node URL: https://localhost:3000/gitlab/#{project.full_path}.git. Documentation: #{EE::Gitlab::GeoGitAccess::GEO_SERVER_DOCS_URL}" "\nPlease use the primary node URL instead: https://localhost:3000/gitlab/#{project.full_path}.git.
For more information: #{EE::Gitlab::GeoGitAccess::GEO_SERVER_DOCS_URL}"
primary_node = create(:geo_node, :primary, url: 'https://localhost:3000/gitlab') primary_node = create(:geo_node, :primary, url: 'https://localhost:3000/gitlab')
allow(Gitlab::Geo).to receive(:primary).and_return(primary_node) allow(Gitlab::Geo).to receive(:primary).and_return(primary_node)
......
...@@ -29,8 +29,10 @@ describe Gitlab::GitAccessWiki do ...@@ -29,8 +29,10 @@ describe Gitlab::GitAccessWiki do
end end
it 'denies push access with primary present' do it 'denies push access with primary present' do
error_message = "You can't push code to a read-only GitLab instance. Please use the Primary node URL: "\ error_message = "You can't push code to a read-only GitLab instance.
"https://localhost:3000/gitlab/#{project.full_path}.wiki.git. Documentation: #{EE::Gitlab::GeoGitAccess::GEO_SERVER_DOCS_URL}" Please use the primary node URL instead: "\
"https://localhost:3000/gitlab/#{project.full_path}.wiki.git.
For more information: #{EE::Gitlab::GeoGitAccess::GEO_SERVER_DOCS_URL}"
primary_node = create(:geo_node, :primary, url: 'https://localhost:3000/gitlab') primary_node = create(:geo_node, :primary, url: 'https://localhost:3000/gitlab')
allow(Gitlab::Geo).to receive(:primary).and_return(primary_node) allow(Gitlab::Geo).to receive(:primary).and_return(primary_node)
......
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