Commit 86df5c67 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Replace deprecated path_with_namespace with full_path

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent 8a0052c0
...@@ -4,16 +4,16 @@ module ImportHelper ...@@ -4,16 +4,16 @@ module ImportHelper
"#{namespace}/#{name}" "#{namespace}/#{name}"
end end
def provider_project_link(provider, path_with_namespace) def provider_project_link(provider, full_path)
url = __send__("#{provider}_project_url", path_with_namespace) # rubocop:disable GitlabSecurity/PublicSend url = __send__("#{provider}_project_url", full_path) # rubocop:disable GitlabSecurity/PublicSend
link_to path_with_namespace, url, target: '_blank', rel: 'noopener noreferrer' link_to full_path, url, target: '_blank', rel: 'noopener noreferrer'
end end
private private
def github_project_url(path_with_namespace) def github_project_url(full_path)
"#{github_root_url}/#{path_with_namespace}" "#{github_root_url}/#{full_path}"
end end
def github_root_url def github_root_url
...@@ -23,7 +23,7 @@ module ImportHelper ...@@ -23,7 +23,7 @@ module ImportHelper
@github_url = provider.fetch('url', 'https://github.com') if provider @github_url = provider.fetch('url', 'https://github.com') if provider
end end
def gitea_project_url(path_with_namespace) def gitea_project_url(full_path)
"#{@gitea_host_url.sub(%r{/+\z}, '')}/#{path_with_namespace}" "#{@gitea_host_url.sub(%r{/+\z}, '')}/#{full_path}"
end end
end end
...@@ -22,7 +22,7 @@ module Gitlab ...@@ -22,7 +22,7 @@ module Gitlab
importer_class.new(object, project, client).execute importer_class.new(object, project, client).execute
counter.increment(project: project.path_with_namespace) counter.increment(project: project.full_path)
end end
def counter def counter
......
...@@ -16,7 +16,7 @@ module Gitlab ...@@ -16,7 +16,7 @@ module Gitlab
def report_import_time(project) def report_import_time(project)
duration = Time.zone.now - project.created_at duration = Time.zone.now - project.created_at
path = project.path_with_namespace path = project.full_path
histogram.observe({ project: path }, duration) histogram.observe({ project: path }, duration)
counter.increment counter.increment
......
...@@ -84,7 +84,7 @@ RSpec.describe 'Dashboard Issues' do ...@@ -84,7 +84,7 @@ RSpec.describe 'Dashboard Issues' do
wait_for_requests wait_for_requests
project_path = "/#{project.path_with_namespace}" project_path = "/#{project.full_path}"
project_json = { name: project.name_with_namespace, url: project_path }.to_json project_json = { name: project.name_with_namespace, url: project_path }.to_json
# simulate selection, and prevent overlap by dropdown menu # simulate selection, and prevent overlap by dropdown menu
......
...@@ -14,13 +14,13 @@ describe ProjectWiki do ...@@ -14,13 +14,13 @@ describe ProjectWiki do
it { is_expected.to delegate_method(:repository_storage_path).to :project } it { is_expected.to delegate_method(:repository_storage_path).to :project }
it { is_expected.to delegate_method(:hashed_storage?).to :project } it { is_expected.to delegate_method(:hashed_storage?).to :project }
describe "#path_with_namespace" do describe "#full_path" do
it "returns the project path with namespace with the .wiki extension" do it "returns the project path with namespace with the .wiki extension" do
expect(subject.path_with_namespace).to eq(project.full_path + '.wiki') expect(subject.full_path).to eq(project.full_path + '.wiki')
end end
it 'returns the same value as #full_path' do it 'returns the same value as #full_path' do
expect(subject.path_with_namespace).to eq(subject.full_path) expect(subject.full_path).to eq(subject.full_path)
end end
end end
......
...@@ -16,7 +16,7 @@ describe API::PagesDomains do ...@@ -16,7 +16,7 @@ describe API::PagesDomains do
let(:route) { "/projects/#{project.id}/pages/domains" } let(:route) { "/projects/#{project.id}/pages/domains" }
let(:route_domain) { "/projects/#{project.id}/pages/domains/#{pages_domain.domain}" } let(:route_domain) { "/projects/#{project.id}/pages/domains/#{pages_domain.domain}" }
let(:route_domain_path) { "/projects/#{project.path_with_namespace.gsub('/', '%2F')}/pages/domains/#{pages_domain.domain}" } let(:route_domain_path) { "/projects/#{project.full_path.gsub('/', '%2F')}/pages/domains/#{pages_domain.domain}" }
let(:route_secure_domain) { "/projects/#{project.id}/pages/domains/#{pages_domain_secure.domain}" } let(:route_secure_domain) { "/projects/#{project.id}/pages/domains/#{pages_domain_secure.domain}" }
let(:route_expired_domain) { "/projects/#{project.id}/pages/domains/#{pages_domain_expired.domain}" } let(:route_expired_domain) { "/projects/#{project.id}/pages/domains/#{pages_domain_expired.domain}" }
let(:route_vacant_domain) { "/projects/#{project.id}/pages/domains/www.vacant-domain.test" } let(:route_vacant_domain) { "/projects/#{project.id}/pages/domains/www.vacant-domain.test" }
......
...@@ -172,7 +172,7 @@ describe Auth::ContainerRegistryAuthenticationService do ...@@ -172,7 +172,7 @@ describe Auth::ContainerRegistryAuthenticationService do
end end
let(:current_params) do let(:current_params) do
{ scope: "repository:#{project.path_with_namespace}:*" } { scope: "repository:#{project.full_path}:*" }
end end
it_behaves_like 'an inaccessible' it_behaves_like 'an inaccessible'
...@@ -200,7 +200,7 @@ describe Auth::ContainerRegistryAuthenticationService do ...@@ -200,7 +200,7 @@ describe Auth::ContainerRegistryAuthenticationService do
end end
let(:current_params) do let(:current_params) do
{ scope: "repository:#{project.path_with_namespace}:*" } { scope: "repository:#{project.full_path}:*" }
end end
it_behaves_like 'an inaccessible' it_behaves_like 'an inaccessible'
...@@ -239,7 +239,7 @@ describe Auth::ContainerRegistryAuthenticationService do ...@@ -239,7 +239,7 @@ describe Auth::ContainerRegistryAuthenticationService do
end end
let(:current_params) do let(:current_params) do
{ scope: "repository:#{project.path_with_namespace}:*" } { scope: "repository:#{project.full_path}:*" }
end end
it_behaves_like 'an inaccessible' it_behaves_like 'an inaccessible'
...@@ -270,7 +270,7 @@ describe Auth::ContainerRegistryAuthenticationService do ...@@ -270,7 +270,7 @@ describe Auth::ContainerRegistryAuthenticationService do
context 'disallow anyone to delete images' do context 'disallow anyone to delete images' do
let(:current_params) do let(:current_params) do
{ scope: "repository:#{project.path_with_namespace}:*" } { scope: "repository:#{project.full_path}:*" }
end end
it_behaves_like 'an inaccessible' it_behaves_like 'an inaccessible'
...@@ -311,7 +311,7 @@ describe Auth::ContainerRegistryAuthenticationService do ...@@ -311,7 +311,7 @@ describe Auth::ContainerRegistryAuthenticationService do
context 'disallow anyone to delete images' do context 'disallow anyone to delete images' do
let(:current_params) do let(:current_params) do
{ scope: "repository:#{project.path_with_namespace}:*" } { scope: "repository:#{project.full_path}:*" }
end end
it_behaves_like 'an inaccessible' it_behaves_like 'an inaccessible'
...@@ -323,7 +323,7 @@ describe Auth::ContainerRegistryAuthenticationService do ...@@ -323,7 +323,7 @@ describe Auth::ContainerRegistryAuthenticationService do
context 'disallow anyone to pull or push images' do context 'disallow anyone to pull or push images' do
let(:current_user) { create(:user, external: true) } let(:current_user) { create(:user, external: true) }
let(:current_params) do let(:current_params) do
{ scope: "repository:#{project.path_with_namespace}:pull,push" } { scope: "repository:#{project.full_path}:pull,push" }
end end
it_behaves_like 'an inaccessible' it_behaves_like 'an inaccessible'
...@@ -333,7 +333,7 @@ describe Auth::ContainerRegistryAuthenticationService do ...@@ -333,7 +333,7 @@ describe Auth::ContainerRegistryAuthenticationService do
context 'disallow anyone to delete images' do context 'disallow anyone to delete images' do
let(:current_user) { create(:user, external: true) } let(:current_user) { create(:user, external: true) }
let(:current_params) do let(:current_params) do
{ scope: "repository:#{project.path_with_namespace}:*" } { scope: "repository:#{project.full_path}:*" }
end end
it_behaves_like 'an inaccessible' it_behaves_like 'an inaccessible'
...@@ -359,7 +359,7 @@ describe Auth::ContainerRegistryAuthenticationService do ...@@ -359,7 +359,7 @@ describe Auth::ContainerRegistryAuthenticationService do
context 'allow to delete images' do context 'allow to delete images' do
let(:current_params) do let(:current_params) do
{ scope: "repository:#{current_project.path_with_namespace}:*" } { scope: "repository:#{current_project.full_path}:*" }
end end
it_behaves_like 'a deletable' do it_behaves_like 'a deletable' do
...@@ -398,7 +398,7 @@ describe Auth::ContainerRegistryAuthenticationService do ...@@ -398,7 +398,7 @@ describe Auth::ContainerRegistryAuthenticationService do
context 'disallow to delete images' do context 'disallow to delete images' do
let(:current_params) do let(:current_params) do
{ scope: "repository:#{current_project.path_with_namespace}:*" } { scope: "repository:#{current_project.full_path}:*" }
end end
it_behaves_like 'an inaccessible' do it_behaves_like 'an inaccessible' do
......
...@@ -30,6 +30,7 @@ describe SystemHooksService do ...@@ -30,6 +30,7 @@ describe SystemHooksService do
:old_path_with_namespace :old_path_with_namespace
) )
end end
it do it do
project.old_path_with_namespace = 'transfered_from_path' project.old_path_with_namespace = 'transfered_from_path'
expect(event_data(project, :transfer)).to include( expect(event_data(project, :transfer)).to include(
...@@ -45,18 +46,21 @@ describe SystemHooksService do ...@@ -45,18 +46,21 @@ describe SystemHooksService do
:owner_name, :owner_email :owner_name, :owner_email
) )
end end
it do it do
expect(event_data(group, :destroy)).to include( expect(event_data(group, :destroy)).to include(
:event_name, :name, :created_at, :updated_at, :path, :group_id, :event_name, :name, :created_at, :updated_at, :path, :group_id,
:owner_name, :owner_email :owner_name, :owner_email
) )
end end
it do it do
expect(event_data(group_member, :create)).to include( expect(event_data(group_member, :create)).to include(
:event_name, :created_at, :updated_at, :group_name, :group_path, :event_name, :created_at, :updated_at, :group_name, :group_path,
:group_id, :user_id, :user_username, :user_name, :user_email, :group_access :group_id, :user_id, :user_username, :user_name, :user_email, :group_access
) )
end end
it do it do
expect(event_data(group_member, :destroy)).to include( expect(event_data(group_member, :destroy)).to include(
:event_name, :created_at, :updated_at, :group_name, :group_path, :event_name, :created_at, :updated_at, :group_name, :group_path,
......
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