Commit 650d758f authored by Douwe Maan's avatar Douwe Maan

Merge branch 'dz-use-less-deprecated-methods' into 'master'

Reduce usage of deprecated *_with_namespace methods

See merge request gitlab-org/gitlab-ce!17523
parents 5656a1d6 9fb733c3
...@@ -62,7 +62,7 @@ class InvitesController < ApplicationController ...@@ -62,7 +62,7 @@ class InvitesController < ApplicationController
case source case source
when Project when Project
project = member.source project = member.source
label = "project #{project.name_with_namespace}" label = "project #{project.full_name}"
path = project_path(project) path = project_path(project)
when Group when Group
group = member.source group = member.source
......
...@@ -38,7 +38,7 @@ class Projects::BlobController < Projects::ApplicationController ...@@ -38,7 +38,7 @@ class Projects::BlobController < Projects::ApplicationController
end end
format.json do format.json do
page_title @blob.path, @ref, @project.name_with_namespace page_title @blob.path, @ref, @project.full_name
show_json show_json
end end
......
...@@ -36,7 +36,7 @@ class Projects::TreeController < Projects::ApplicationController ...@@ -36,7 +36,7 @@ class Projects::TreeController < Projects::ApplicationController
end end
format.json do format.json do
page_title @path.presence || _("Files"), @ref, @project.name_with_namespace page_title @path.presence || _("Files"), @ref, @project.full_name
# n+1: https://gitlab.com/gitlab-org/gitlab-ce/issues/38261 # n+1: https://gitlab.com/gitlab-org/gitlab-ce/issues/38261
Gitlab::GitalyClient.allow_n_plus_1_calls do Gitlab::GitalyClient.allow_n_plus_1_calls do
......
...@@ -130,7 +130,7 @@ class ProjectsController < Projects::ApplicationController ...@@ -130,7 +130,7 @@ class ProjectsController < Projects::ApplicationController
return access_denied! unless can?(current_user, :remove_project, @project) return access_denied! unless can?(current_user, :remove_project, @project)
::Projects::DestroyService.new(@project, current_user, {}).async_execute ::Projects::DestroyService.new(@project, current_user, {}).async_execute
flash[:notice] = _("Project '%{project_name}' is in the process of being deleted.") % { project_name: @project.name_with_namespace } flash[:notice] = _("Project '%{project_name}' is in the process of being deleted.") % { project_name: @project.full_name }
redirect_to dashboard_projects_path, status: 302 redirect_to dashboard_projects_path, status: 302
rescue Projects::DestroyService::DestroyError => ex rescue Projects::DestroyService::DestroyError => ex
......
...@@ -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
...@@ -99,7 +99,7 @@ module IssuablesHelper ...@@ -99,7 +99,7 @@ module IssuablesHelper
project = Project.find_by(id: project_id) project = Project.find_by(id: project_id)
if project if project
project.name_with_namespace project.full_name
else else
default_label default_label
end end
......
...@@ -97,13 +97,13 @@ module ProjectsHelper ...@@ -97,13 +97,13 @@ module ProjectsHelper
end end
def remove_project_message(project) def remove_project_message(project)
_("You are going to remove %{project_name_with_namespace}. Removed project CANNOT be restored! Are you ABSOLUTELY sure?") % _("You are going to remove %{project_full_name}. Removed project CANNOT be restored! Are you ABSOLUTELY sure?") %
{ project_name_with_namespace: project.name_with_namespace } { project_full_name: project.full_name }
end end
def transfer_project_message(project) def transfer_project_message(project)
_("You are going to transfer %{project_name_with_namespace} to another owner. Are you ABSOLUTELY sure?") % _("You are going to transfer %{project_full_name} to another owner. Are you ABSOLUTELY sure?") %
{ project_name_with_namespace: project.name_with_namespace } { project_full_name: project.full_name }
end end
def remove_fork_project_message(project) def remove_fork_project_message(project)
......
...@@ -110,7 +110,7 @@ module SearchHelper ...@@ -110,7 +110,7 @@ module SearchHelper
category: "Projects", category: "Projects",
id: p.id, id: p.id,
value: "#{search_result_sanitize(p.name)}", value: "#{search_result_sanitize(p.name)}",
label: "#{search_result_sanitize(p.name_with_namespace)}", label: "#{search_result_sanitize(p.full_name)}",
url: project_path(p) url: project_path(p)
} }
end end
......
...@@ -114,7 +114,7 @@ module TodosHelper ...@@ -114,7 +114,7 @@ module TodosHelper
projects = current_user.authorized_projects.sorted_by_activity.non_archived.with_route projects = current_user.authorized_projects.sorted_by_activity.non_archived.with_route
projects = projects.map do |project| projects = projects.map do |project|
{ id: project.id, text: project.name_with_namespace } { id: project.id, text: project.full_name }
end end
projects.unshift({ id: '', text: 'Any Project' }).to_json projects.unshift({ id: '', text: 'Any Project' }).to_json
......
...@@ -158,7 +158,7 @@ class Event < ActiveRecord::Base ...@@ -158,7 +158,7 @@ class Event < ActiveRecord::Base
def project_name def project_name
if project if project
project.name_with_namespace project.full_name
else else
"(deleted project)" "(deleted project)"
end end
......
...@@ -68,7 +68,7 @@ http://app.asana.com/-/account_api' ...@@ -68,7 +68,7 @@ http://app.asana.com/-/account_api'
end end
user = data[:user_name] user = data[:user_name]
project_name = project.name_with_namespace project_name = project.full_name
data[:commits].each do |commit| data[:commits].each do |commit|
push_msg = "#{user} pushed to branch #{branch} of #{project_name} ( #{commit[:url]} ):" push_msg = "#{user} pushed to branch #{branch} of #{project_name} ( #{commit[:url]} ):"
......
...@@ -86,7 +86,7 @@ class CampfireService < Service ...@@ -86,7 +86,7 @@ class CampfireService < Service
after = push[:after] after = push[:after]
message = "" message = ""
message << "[#{project.name_with_namespace}] " message << "[#{project.full_name}] "
message << "#{push[:user_name]} " message << "#{push[:user_name]} "
if Gitlab::Git.blank_ref?(before) if Gitlab::Git.blank_ref?(before)
......
...@@ -129,7 +129,7 @@ class ChatNotificationService < Service ...@@ -129,7 +129,7 @@ class ChatNotificationService < Service
end end
def project_name def project_name
project.name_with_namespace.gsub(/\s/, '') project.full_name.gsub(/\s/, '')
end end
def project_url def project_url
......
...@@ -120,7 +120,7 @@ class HipchatService < Service ...@@ -120,7 +120,7 @@ class HipchatService < Service
else else
message << "pushed to #{ref_type} <a href=\""\ message << "pushed to #{ref_type} <a href=\""\
"#{project.web_url}/commits/#{CGI.escape(ref)}\">#{ref}</a> " "#{project.web_url}/commits/#{CGI.escape(ref)}\">#{ref}</a> "
message << "of <a href=\"#{project.web_url}\">#{project.name_with_namespace.gsub!(/\s/, '')}</a> " message << "of <a href=\"#{project.web_url}\">#{project.full_name.gsub!(/\s/, '')}</a> "
message << "(<a href=\"#{project.web_url}/compare/#{before}...#{after}\">Compare changes</a>)" message << "(<a href=\"#{project.web_url}/compare/#{before}...#{after}\">Compare changes</a>)"
push[:commits].take(MAX_COMMITS).each do |commit| push[:commits].take(MAX_COMMITS).each do |commit|
...@@ -274,7 +274,7 @@ class HipchatService < Service ...@@ -274,7 +274,7 @@ class HipchatService < Service
end end
def project_name def project_name
project.name_with_namespace.gsub(/\s/, '') project.full_name.gsub(/\s/, '')
end end
def project_url def project_url
......
...@@ -37,7 +37,7 @@ class MattermostSlashCommandsService < SlashCommandsService ...@@ -37,7 +37,7 @@ class MattermostSlashCommandsService < SlashCommandsService
private private
def command(params) def command(params)
pretty_project_name = project.name_with_namespace pretty_project_name = project.full_name
params.merge( params.merge(
auto_complete: true, auto_complete: true,
......
...@@ -88,10 +88,10 @@ class PushoverService < Service ...@@ -88,10 +88,10 @@ class PushoverService < Service
user: user_key, user: user_key,
device: device, device: device,
priority: priority, priority: priority,
title: "#{project.name_with_namespace}", title: "#{project.full_name}",
message: message, message: message,
url: data[:project][:web_url], url: data[:project][:web_url],
url_title: "See project #{project.name_with_namespace}" url_title: "See project #{project.full_name}"
} }
# Sound parameter MUST NOT be sent to API if not selected # Sound parameter MUST NOT be sent to API if not selected
......
...@@ -164,7 +164,7 @@ ...@@ -164,7 +164,7 @@
%h4 Latest projects %h4 Latest projects
- @projects.each do |project| - @projects.each do |project|
%p %p
= link_to project.name_with_namespace, [:admin, project.namespace.becomes(Namespace), project], class: 'str-truncated-60' = link_to project.full_name, [:admin, project.namespace.becomes(Namespace), project], class: 'str-truncated-60'
%span.light.pull-right %span.light.pull-right
#{time_ago_with_tooltip(project.created_at)} #{time_ago_with_tooltip(project.created_at)}
.col-md-4 .col-md-4
......
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
- @projects.each do |project| - @projects.each do |project|
%li %li
%strong %strong
= link_to project.name_with_namespace, [:admin, project.namespace.becomes(Namespace), project] = link_to project.full_name, [:admin, project.namespace.becomes(Namespace), project]
%span.badge %span.badge
= storage_counter(project.statistics.storage_size) = storage_counter(project.statistics.storage_size)
%span.pull-right.light %span.pull-right.light
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
- @group.shared_projects.sort_by(&:name).each do |project| - @group.shared_projects.sort_by(&:name).each do |project|
%li %li
%strong %strong
= link_to project.name_with_namespace, [:admin, project.namespace.becomes(Namespace), project] = link_to project.full_name, [:admin, project.namespace.becomes(Namespace), project]
%span.badge %span.badge
= storage_counter(project.statistics.storage_size) = storage_counter(project.statistics.storage_size)
%span.pull-right.light %span.pull-right.light
......
- add_to_breadcrumbs "Projects", admin_projects_path - add_to_breadcrumbs "Projects", admin_projects_path
- breadcrumb_title @project.name_with_namespace - breadcrumb_title @project.full_name
- page_title @project.name_with_namespace, "Projects" - page_title @project.full_name, "Projects"
%h3.page-title %h3.page-title
Project: #{@project.name_with_namespace} Project: #{@project.full_name}
= link_to edit_project_path(@project), class: "btn btn-nr pull-right" do = link_to edit_project_path(@project), class: "btn btn-nr pull-right" do
%i.fa.fa-pencil-square-o %i.fa.fa-pencil-square-o
Edit Edit
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
%tr.alert-info %tr.alert-info
%td %td
%strong %strong
= project.name_with_namespace = project.full_name
%td %td
.pull-right .pull-right
= link_to 'Disable', [:admin, project.namespace.becomes(Namespace), project, runner_project], method: :delete, class: 'btn btn-danger btn-xs' = link_to 'Disable', [:admin, project.namespace.becomes(Namespace), project, runner_project], method: :delete, class: 'btn btn-danger btn-xs'
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
- @projects.each do |project| - @projects.each do |project|
%tr %tr
%td %td
= project.name_with_namespace = project.full_name
%td %td
.pull-right .pull-right
= form_for [:admin, project.namespace.becomes(Namespace), project, project.runner_projects.new] do |f| = form_for [:admin, project.namespace.becomes(Namespace), project, project.runner_projects.new] do |f|
...@@ -95,7 +95,7 @@ ...@@ -95,7 +95,7 @@
%td.status %td.status
- if project - if project
= project.name_with_namespace = project.full_name
%td.build-link %td.build-link
- if project - if project
......
...@@ -29,12 +29,12 @@ ...@@ -29,12 +29,12 @@
.panel.panel-default .panel.panel-default
.panel-heading Joined projects (#{@joined_projects.count}) .panel-heading Joined projects (#{@joined_projects.count})
%ul.well-list %ul.well-list
- @joined_projects.sort_by(&:name_with_namespace).each do |project| - @joined_projects.sort_by(&:full_name).each do |project|
- member = project.team.find_member(@user.id) - member = project.team.find_member(@user.id)
%li.project_member %li.project_member
.list-item-name .list-item-name
= link_to admin_project_path(project), class: dom_class(project) do = link_to admin_project_path(project), class: dom_class(project) do
= project.name_with_namespace = project.full_name
- if member - if member
.pull-right .pull-right
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
.list-item-name .list-item-name
%span{ class: visibility_level_color(project.visibility_level) } %span{ class: visibility_level_color(project.visibility_level) }
= visibility_level_icon(project.visibility_level) = visibility_level_icon(project.visibility_level)
%strong= link_to project.name_with_namespace, project %strong= link_to project.full_name, project
.pull-right .pull-right
- if project.archived - if project.archived
%span.label.label-warning archived %span.label.label-warning archived
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
- project = @member.source - project = @member.source
project project
%strong %strong
= link_to project.name_with_namespace, project_url(project) = link_to project.full_name, project_url(project)
- when Group - when Group
- group = @member.source - group = @member.source
group group
......
- project_meta = { id: @project.id, name: @project.name, namespace: @project.name_with_namespace, web_url: project_path(@project), avatar_url: @project.avatar_url } if @project&.persisted? - project_meta = { id: @project.id, name: @project.name, namespace: @project.full_name, web_url: project_path(@project), avatar_url: @project.avatar_url } if @project&.persisted?
.projects-dropdown-container .projects-dropdown-container
.project-dropdown-sidebar.qa-projects-dropdown-sidebar .project-dropdown-sidebar.qa-projects-dropdown-sidebar
%ul %ul
......
- page_title @project.name_with_namespace - page_title @project.full_name
- page_description @project.description unless page_description - page_description @project.description unless page_description
- header_title project_title(@project) unless header_title - header_title project_title(@project) unless header_title
- nav "project" - nav "project"
......
...@@ -3,6 +3,6 @@ ...@@ -3,6 +3,6 @@
%p %p
The project export can be downloaded from: The project export can be downloaded from:
= link_to download_export_project_url(@project), rel: 'nofollow', download: '' do = link_to download_export_project_url(@project), rel: 'nofollow', download: '' do
= @project.name_with_namespace + " export" = @project.full_name + " export"
%p %p
The download link will expire in 24 hours. The download link will expire in 24 hours.
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
%p %p
The project is now located under The project is now located under
= link_to project_url(@project) do = link_to project_url(@project) do
= @project.name_with_namespace = @project.full_name
%p %p
To update the remote url in your local repository run (for ssh): To update the remote url in your local repository run (for ssh):
%p{ style: "background: #f5f5f5; padding:10px; border:1px solid #ddd" } %p{ style: "background: #f5f5f5; padding:10px; border:1px solid #ddd" }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
%td %td
%strong %strong
- if can?(current_user, :read_project, project) - if can?(current_user, :read_project, project)
= link_to project.name_with_namespace, project_path(project) = link_to project.full_name, project_path(project)
- else - else
.light N/A .light N/A
%td %td
......
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
- if admin - if admin
%td %td
- if job.project - if job.project
= link_to job.project.name_with_namespace, admin_project_path(job.project) = link_to job.project.full_name, admin_project_path(job.project)
%td %td
- if job.try(:runner) - if job.try(:runner)
= runner_link(job.runner) = runner_link(job.runner)
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
- if admin - if admin
%td %td
- if generic_commit_status.project - if generic_commit_status.project
= link_to generic_commit_status.project.name_with_namespace, admin_project_path(generic_commit_status.project) = link_to generic_commit_status.project.full_name, admin_project_path(generic_commit_status.project)
%td %td
- if generic_commit_status.try(:runner) - if generic_commit_status.try(:runner)
= runner_link(generic_commit_status.runner) = runner_link(generic_commit_status.runner)
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
- unless @issue.project.id == merge_request.target_project.id - unless @issue.project.id == merge_request.target_project.id
in in
- project = merge_request.target_project - project = merge_request.target_project
= link_to project.name_with_namespace, project_path(project) = link_to project.full_name, project_path(project)
- if merge_request.merged? - if merge_request.merged?
%span.merge-request-status.prepend-left-10.merged %span.merge-request-status.prepend-left-10.merged
......
- run_actions_text = "Perform common operations on GitLab project: #{@project.name_with_namespace}" - run_actions_text = "Perform common operations on GitLab project: #{@project.full_name}"
%p To setup this service: %p To setup this service:
%ul.list-unstyled.indent-list %ul.list-unstyled.indent-list
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
.form-group .form-group
= label_tag :display_name, 'Display name', class: 'col-sm-2 col-xs-12 control-label' = label_tag :display_name, 'Display name', class: 'col-sm-2 col-xs-12 control-label'
.col-sm-10.col-xs-12.input-group .col-sm-10.col-xs-12.input-group
= text_field_tag :display_name, "GitLab / #{@project.name_with_namespace}", class: 'form-control input-sm', readonly: 'readonly' = text_field_tag :display_name, "GitLab / #{@project.full_name}", class: 'form-control input-sm', readonly: 'readonly'
.input-group-btn .input-group-btn
= clipboard_button(target: '#display_name') = clipboard_button(target: '#display_name')
......
- pretty_name = defined?(@project) ? @project.name_with_namespace : 'namespace / path' - pretty_name = defined?(@project) ? @project.full_name : 'namespace / path'
- run_actions_text = "Perform common operations on GitLab project: #{pretty_name}" - run_actions_text = "Perform common operations on GitLab project: #{pretty_name}"
.well .well
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
%span.dropdown-toggle-text %span.dropdown-toggle-text
Project: Project:
- if @project.present? - if @project.present?
= @project.name_with_namespace = @project.full_name
- else - else
Any Any
= icon("chevron-down") = icon("chevron-down")
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
= search_entries_info(@search_objects, @scope, @search_term) = search_entries_info(@search_objects, @scope, @search_term)
- unless @show_snippets - unless @show_snippets
- if @project - if @project
in project #{link_to @project.name_with_namespace, [@project.namespace.becomes(Namespace), @project]} in project #{link_to @project.full_name, [@project.namespace.becomes(Namespace), @project]}
- elsif @group - elsif @group
in group #{link_to @group.name, @group} in group #{link_to @group.name, @group}
......
...@@ -10,4 +10,4 @@ ...@@ -10,4 +10,4 @@
.description.term .description.term
= search_md_sanitize(issue, :description) = search_md_sanitize(issue, :description)
%span.light %span.light
#{issue.project.name_with_namespace} #{issue.project.full_name}
...@@ -11,4 +11,4 @@ ...@@ -11,4 +11,4 @@
.description.term .description.term
= search_md_sanitize(merge_request, :description) = search_md_sanitize(merge_request, :description)
%span.light %span.light
#{merge_request.project.name_with_namespace} #{merge_request.project.full_name}
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
%i.fa.fa-comment %i.fa.fa-comment
= link_to_member(project, note.author, avatar: false) = link_to_member(project, note.author, avatar: false)
commented on commented on
= link_to project.name_with_namespace, project = link_to project.full_name, project
&middot; &middot;
- if note.for_commit? - if note.for_commit?
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
%small.pull-right.cgray %small.pull-right.cgray
- if snippet_title.project_id? - if snippet_title.project_id?
= link_to snippet_title.project.name_with_namespace, project_path(snippet_title.project) = link_to snippet_title.project.full_name, project_path(snippet_title.project)
.snippet-info .snippet-info
= snippet_title.to_reference = snippet_title.to_reference
......
- noteable = @sent_notification.noteable - noteable = @sent_notification.noteable
- noteable_type = @sent_notification.noteable_type.titleize.downcase - noteable_type = @sent_notification.noteable_type.titleize.downcase
- noteable_text = %(#{noteable.title} (#{noteable.to_reference})) - noteable_text = %(#{noteable.title} (#{noteable.to_reference}))
- page_title "Unsubscribe", noteable_text, noteable_type.pluralize, @sent_notification.project.name_with_namespace - page_title "Unsubscribe", noteable_text, noteable_type.pluralize, @sent_notification.project.full_name
%h3.page-title %h3.page-title
Unsubscribe from #{noteable_type} Unsubscribe from #{noteable_type}
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
- if show_project_name - if show_project_name
%strong #{project.name} &middot; %strong #{project.name} &middot;
- elsif show_full_project_name - elsif show_full_project_name
%strong #{project.name_with_namespace} &middot; %strong #{project.full_name} &middot;
- if issuable.is_a?(Issue) - if issuable.is_a?(Issue)
= confidential_icon(issuable) = confidential_icon(issuable)
= link_to issuable.title, issuable_url_args, title: issuable.title = link_to issuable.title, issuable_url_args, title: issuable.title
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
- milestone.milestones.each do |milestone| - milestone.milestones.each do |milestone|
= link_to milestone_path(milestone) do = link_to milestone_path(milestone) do
%span.label.label-gray %span.label.label-gray
= dashboard ? milestone.project.name_with_namespace : milestone.project.name = dashboard ? milestone.project.full_name : milestone.project.name
- if @group - if @group
.col-sm-6.milestone-actions .col-sm-6.milestone-actions
- if can?(current_user, :admin_milestones, @group) - if can?(current_user, :admin_milestones, @group)
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
- milestone.milestones.each do |ms| - milestone.milestones.each do |ms|
%tr %tr
%td %td
- project_name = group ? ms.project.name : ms.project.name_with_namespace - project_name = group ? ms.project.name : ms.project.full_name
= link_to project_name, project_milestone_path(ms.project, ms) = link_to project_name, project_milestone_path(ms.project, ms)
%td %td
= ms.issues_visible_to_user(current_user).opened.count = ms.issues_visible_to_user(current_user).opened.count
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
%span.hidden-xs %span.hidden-xs
in in
= link_to project_path(snippet.project) do = link_to project_path(snippet.project) do
= snippet.project.name_with_namespace = snippet.project.full_name
.pull-right.snippet-updated-at .pull-right.snippet-updated-at
%span updated #{time_ago_with_tooltip(snippet.updated_at, placement: 'bottom')} %span updated #{time_ago_with_tooltip(snippet.updated_at, placement: 'bottom')}
...@@ -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
......
...@@ -246,7 +246,7 @@ describe AutocompleteController do ...@@ -246,7 +246,7 @@ describe AutocompleteController do
expect(json_response.size).to eq(1) expect(json_response.size).to eq(1)
expect(json_response.first['id']).to eq authorized_project.id expect(json_response.first['id']).to eq authorized_project.id
expect(json_response.first['name_with_namespace']).to eq authorized_project.name_with_namespace expect(json_response.first['name_with_namespace']).to eq authorized_project.full_name
end end
end end
end end
...@@ -267,7 +267,7 @@ describe AutocompleteController do ...@@ -267,7 +267,7 @@ describe AutocompleteController do
expect(json_response.size).to eq(1) expect(json_response.size).to eq(1)
expect(json_response.first['id']).to eq authorized_search_project.id expect(json_response.first['id']).to eq authorized_search_project.id
expect(json_response.first['name_with_namespace']).to eq authorized_search_project.name_with_namespace expect(json_response.first['name_with_namespace']).to eq authorized_search_project.full_name
end end
end end
end end
......
...@@ -173,7 +173,7 @@ feature 'Admin Groups' do ...@@ -173,7 +173,7 @@ feature 'Admin Groups' do
visit admin_group_path(group) visit admin_group_path(group)
expect(page).to have_content(empty_project.name_with_namespace) expect(page).to have_content(empty_project.full_name)
expect(page).to have_content('Projects shared with') expect(page).to have_content('Projects shared with')
end end
end end
......
...@@ -58,7 +58,7 @@ describe "Admin::Projects" do ...@@ -58,7 +58,7 @@ describe "Admin::Projects" do
expect(current_path).to eq admin_project_path(project) expect(current_path).to eq admin_project_path(project)
expect(page).to have_content(project.path) expect(page).to have_content(project.path)
expect(page).to have_content(project.name) expect(page).to have_content(project.name)
expect(page).to have_content(project.name_with_namespace) expect(page).to have_content(project.full_name)
expect(page).to have_content(project.creator.name) expect(page).to have_content(project.creator.name)
end end
end end
......
...@@ -76,8 +76,8 @@ describe "Admin Runners" do ...@@ -76,8 +76,8 @@ describe "Admin Runners" do
describe 'projects' do describe 'projects' do
it 'contains project names' do it 'contains project names' do
expect(page).to have_content(@project1.name_with_namespace) expect(page).to have_content(@project1.full_name)
expect(page).to have_content(@project2.name_with_namespace) expect(page).to have_content(@project2.full_name)
end end
end end
...@@ -89,8 +89,8 @@ describe "Admin Runners" do ...@@ -89,8 +89,8 @@ describe "Admin Runners" do
end end
it 'contains name of correct project' do it 'contains name of correct project' do
expect(page).to have_content(@project1.name_with_namespace) expect(page).to have_content(@project1.full_name)
expect(page).not_to have_content(@project2.name_with_namespace) expect(page).not_to have_content(@project2.full_name)
end end
end end
......
...@@ -74,8 +74,8 @@ RSpec.describe 'Dashboard Issues' do ...@@ -74,8 +74,8 @@ RSpec.describe 'Dashboard Issues' do
find('.new-project-item-select-button').click find('.new-project-item-select-button').click
page.within('.select2-results') do page.within('.select2-results') do
expect(page).to have_content(project.name_with_namespace) expect(page).to have_content(project.full_name)
expect(page).not_to have_content(project_with_issues_disabled.name_with_namespace) expect(page).not_to have_content(project_with_issues_disabled.full_name)
end end
end end
...@@ -84,8 +84,8 @@ RSpec.describe 'Dashboard Issues' do ...@@ -84,8 +84,8 @@ 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.full_name, url: project_path }.to_json
# simulate selection, and prevent overlap by dropdown menu # simulate selection, and prevent overlap by dropdown menu
first('.project-item-select', visible: false) first('.project-item-select', visible: false)
......
...@@ -28,8 +28,8 @@ feature 'Dashboard Merge Requests' do ...@@ -28,8 +28,8 @@ feature 'Dashboard Merge Requests' do
find('.new-project-item-select-button').click find('.new-project-item-select-button').click
page.within('.select2-results') do page.within('.select2-results') do
expect(page).to have_content(project.name_with_namespace) expect(page).to have_content(project.full_name)
expect(page).not_to have_content(project_with_disabled_merge_requests.name_with_namespace) expect(page).not_to have_content(project_with_disabled_merge_requests.full_name)
end end
end end
end end
......
...@@ -24,14 +24,14 @@ feature 'Dashboard > User filters todos', :js do ...@@ -24,14 +24,14 @@ feature 'Dashboard > User filters todos', :js do
it 'filters by project' do it 'filters by project' do
click_button 'Project' click_button 'Project'
within '.dropdown-menu-project' do within '.dropdown-menu-project' do
fill_in 'Search projects', with: project_1.name_with_namespace fill_in 'Search projects', with: project_1.full_name
click_link project_1.name_with_namespace click_link project_1.full_name
end end
wait_for_requests wait_for_requests
expect(page).to have_content project_1.name_with_namespace expect(page).to have_content project_1.full_name
expect(page).not_to have_content project_2.name_with_namespace expect(page).not_to have_content project_2.full_name
end end
context 'Author filter' do context 'Author filter' do
......
...@@ -73,7 +73,7 @@ feature 'issue move to another project' do ...@@ -73,7 +73,7 @@ feature 'issue move to another project' do
wait_for_requests wait_for_requests
page.within '.js-sidebar-move-issue-block' do page.within '.js-sidebar-move-issue-block' do
expect(page).to have_content new_project.name_with_namespace expect(page).to have_content new_project.full_name
end end
end end
end end
......
...@@ -25,7 +25,7 @@ feature 'Projects > Members > Master manages access requests' do ...@@ -25,7 +25,7 @@ feature 'Projects > Members > Master manages access requests' do
perform_enqueued_jobs { click_on 'Grant access' } perform_enqueued_jobs { click_on 'Grant access' }
expect(ActionMailer::Base.deliveries.last.to).to eq [user.notification_email] expect(ActionMailer::Base.deliveries.last.to).to eq [user.notification_email]
expect(ActionMailer::Base.deliveries.last.subject).to match "Access to the #{project.name_with_namespace} project was granted" expect(ActionMailer::Base.deliveries.last.subject).to match "Access to the #{project.full_name} project was granted"
end end
scenario 'master can deny access' do scenario 'master can deny access' do
...@@ -36,7 +36,7 @@ feature 'Projects > Members > Master manages access requests' do ...@@ -36,7 +36,7 @@ feature 'Projects > Members > Master manages access requests' do
perform_enqueued_jobs { click_on 'Deny access' } perform_enqueued_jobs { click_on 'Deny access' }
expect(ActionMailer::Base.deliveries.last.to).to eq [user.notification_email] expect(ActionMailer::Base.deliveries.last.to).to eq [user.notification_email]
expect(ActionMailer::Base.deliveries.last.subject).to match "Access to the #{project.name_with_namespace} project was denied" expect(ActionMailer::Base.deliveries.last.subject).to match "Access to the #{project.full_name} project was denied"
end end
def expect_visible_access_request(project, user) def expect_visible_access_request(project, user)
......
...@@ -21,7 +21,7 @@ feature 'Projects > Members > User requests access', :js do ...@@ -21,7 +21,7 @@ feature 'Projects > Members > User requests access', :js do
perform_enqueued_jobs { click_link 'Request Access' } perform_enqueued_jobs { click_link 'Request Access' }
expect(ActionMailer::Base.deliveries.last.to).to eq [master.notification_email] expect(ActionMailer::Base.deliveries.last.to).to eq [master.notification_email]
expect(ActionMailer::Base.deliveries.last.subject).to eq "Request to join the #{project.name_with_namespace} project" expect(ActionMailer::Base.deliveries.last.subject).to eq "Request to join the #{project.full_name} project"
expect(project.requesters.exists?(user_id: user)).to be_truthy expect(project.requesters.exists?(user_id: user)).to be_truthy
expect(page).to have_content 'Your request for access has been queued for review.' expect(page).to have_content 'Your request for access has been queued for review.'
......
...@@ -39,7 +39,7 @@ describe 'User manages project members' do ...@@ -39,7 +39,7 @@ describe 'User manages project members' do
click_link('Import') click_link('Import')
end end
select(project2.name_with_namespace, from: 'source_project_id') select(project2.full_name, from: 'source_project_id')
click_button('Import') click_button('Import')
project_member = project.project_members.find_by(user_id: user_mike.id) project_member = project.project_members.find_by(user_id: user_mike.id)
......
...@@ -35,7 +35,7 @@ describe 'User searches for code' do ...@@ -35,7 +35,7 @@ describe 'User searches for code' do
find('.js-search-project-dropdown').click find('.js-search-project-dropdown').click
page.within('.project-filter') do page.within('.project-filter') do
click_link(project.name_with_namespace) click_link(project.full_name)
end end
fill_in('dashboard_search', with: 'rspec') fill_in('dashboard_search', with: 'rspec')
......
...@@ -34,7 +34,7 @@ describe 'User searches for issues', :js do ...@@ -34,7 +34,7 @@ describe 'User searches for issues', :js do
find('.js-search-project-dropdown').click find('.js-search-project-dropdown').click
page.within('.project-filter') do page.within('.project-filter') do
click_link(project.name_with_namespace) click_link(project.full_name)
end end
fill_in('dashboard_search', with: issue1.title) fill_in('dashboard_search', with: issue1.title)
......
...@@ -33,7 +33,7 @@ describe 'User searches for merge requests', :js do ...@@ -33,7 +33,7 @@ describe 'User searches for merge requests', :js do
find('.js-search-project-dropdown').click find('.js-search-project-dropdown').click
page.within('.project-filter') do page.within('.project-filter') do
click_link(project.name_with_namespace) click_link(project.full_name)
end end
fill_in('dashboard_search', with: merge_request1.title) fill_in('dashboard_search', with: merge_request1.title)
......
...@@ -33,7 +33,7 @@ describe 'User searches for milestones', :js do ...@@ -33,7 +33,7 @@ describe 'User searches for milestones', :js do
find('.js-search-project-dropdown').click find('.js-search-project-dropdown').click
page.within('.project-filter') do page.within('.project-filter') do
click_link(project.name_with_namespace) click_link(project.full_name)
end end
fill_in('dashboard_search', with: milestone1.title) fill_in('dashboard_search', with: milestone1.title)
......
...@@ -18,7 +18,7 @@ describe 'User searches for wiki pages', :js do ...@@ -18,7 +18,7 @@ describe 'User searches for wiki pages', :js do
find('.js-search-project-dropdown').click find('.js-search-project-dropdown').click
page.within('.project-filter') do page.within('.project-filter') do
click_link(project.name_with_namespace) click_link(project.full_name)
end end
fill_in('dashboard_search', with: 'content') fill_in('dashboard_search', with: 'content')
......
...@@ -31,7 +31,7 @@ describe 'User uses search filters', :js do ...@@ -31,7 +31,7 @@ describe 'User uses search filters', :js do
wait_for_requests wait_for_requests
expect(page).to have_link(group_project.name_with_namespace) expect(page).to have_link(group_project.full_name)
end end
end end
end end
...@@ -43,10 +43,10 @@ describe 'User uses search filters', :js do ...@@ -43,10 +43,10 @@ describe 'User uses search filters', :js do
wait_for_requests wait_for_requests
click_link(project.name_with_namespace) click_link(project.full_name)
end end
expect(find('.js-search-project-dropdown')).to have_content(project.name_with_namespace) expect(find('.js-search-project-dropdown')).to have_content(project.full_name)
end end
end end
end end
...@@ -12,10 +12,10 @@ describe MembersHelper do ...@@ -12,10 +12,10 @@ describe MembersHelper do
let(:group_member_invite) { build(:group_member, group: group).tap { |m| m.generate_invite_token! } } let(:group_member_invite) { build(:group_member, group: group).tap { |m| m.generate_invite_token! } }
let(:group_member_request) { group.request_access(requester) } let(:group_member_request) { group.request_access(requester) }
it { expect(remove_member_message(project_member)).to eq "Are you sure you want to remove #{project_member.user.name} from the #{project.name_with_namespace} project?" } it { expect(remove_member_message(project_member)).to eq "Are you sure you want to remove #{project_member.user.name} from the #{project.full_name} project?" }
it { expect(remove_member_message(project_member_invite)).to eq "Are you sure you want to revoke the invitation for #{project_member_invite.invite_email} to join the #{project.name_with_namespace} project?" } it { expect(remove_member_message(project_member_invite)).to eq "Are you sure you want to revoke the invitation for #{project_member_invite.invite_email} to join the #{project.full_name} project?" }
it { expect(remove_member_message(project_member_request)).to eq "Are you sure you want to deny #{requester.name}'s request to join the #{project.name_with_namespace} project?" } it { expect(remove_member_message(project_member_request)).to eq "Are you sure you want to deny #{requester.name}'s request to join the #{project.full_name} project?" }
it { expect(remove_member_message(project_member_request, user: requester)).to eq "Are you sure you want to withdraw your access request for the #{project.name_with_namespace} project?" } it { expect(remove_member_message(project_member_request, user: requester)).to eq "Are you sure you want to withdraw your access request for the #{project.full_name} project?" }
it { expect(remove_member_message(group_member)).to eq "Are you sure you want to remove #{group_member.user.name} from the #{group.name} group?" } it { expect(remove_member_message(group_member)).to eq "Are you sure you want to remove #{group_member.user.name} from the #{group.name} group?" }
it { expect(remove_member_message(group_member_invite)).to eq "Are you sure you want to revoke the invitation for #{group_member_invite.invite_email} to join the #{group.name} group?" } it { expect(remove_member_message(group_member_invite)).to eq "Are you sure you want to revoke the invitation for #{group_member_invite.invite_email} to join the #{group.name} group?" }
it { expect(remove_member_message(group_member_request)).to eq "Are you sure you want to deny #{requester.name}'s request to join the #{group.name} group?" } it { expect(remove_member_message(group_member_request)).to eq "Are you sure you want to deny #{requester.name}'s request to join the #{group.name} group?" }
...@@ -42,7 +42,7 @@ describe MembersHelper do ...@@ -42,7 +42,7 @@ describe MembersHelper do
let(:group) { build_stubbed(:group) } let(:group) { build_stubbed(:group) }
let(:user) { build_stubbed(:user) } let(:user) { build_stubbed(:user) }
it { expect(leave_confirmation_message(project)).to eq "Are you sure you want to leave the \"#{project.name_with_namespace}\" project?" } it { expect(leave_confirmation_message(project)).to eq "Are you sure you want to leave the \"#{project.full_name}\" project?" }
it { expect(leave_confirmation_message(group)).to eq "Are you sure you want to leave the \"#{group.name}\" group?" } it { expect(leave_confirmation_message(group)).to eq "Are you sure you want to leave the \"#{group.name}\" group?" }
end end
end end
...@@ -26,8 +26,8 @@ describe TodosHelper do ...@@ -26,8 +26,8 @@ describe TodosHelper do
expected_results = [ expected_results = [
{ 'id' => '', 'text' => 'Any Project' }, { 'id' => '', 'text' => 'Any Project' },
{ 'id' => projects.second.id, 'text' => projects.second.name_with_namespace }, { 'id' => projects.second.id, 'text' => projects.second.full_name },
{ 'id' => projects.first.id, 'text' => projects.first.name_with_namespace } { 'id' => projects.first.id, 'text' => projects.first.full_name }
] ]
expect(JSON.parse(helper.todo_projects_options)).to match_array(expected_results) expect(JSON.parse(helper.todo_projects_options)).to match_array(expected_results)
......
...@@ -381,11 +381,11 @@ describe Banzai::Filter::LabelReferenceFilter do ...@@ -381,11 +381,11 @@ describe Banzai::Filter::LabelReferenceFilter do
end end
it 'has valid link text' do it 'has valid link text' do
expect(result.css('a').first.text).to eq "#{label.name} in #{project2.name_with_namespace}" expect(result.css('a').first.text).to eq "#{label.name} in #{project2.full_name}"
end end
it 'has valid text' do it 'has valid text' do
expect(result.text).to eq "See #{label.name} in #{project2.name_with_namespace}" expect(result.text).to eq "See #{label.name} in #{project2.full_name}"
end end
it 'ignores invalid IDs on the referenced label' do it 'ignores invalid IDs on the referenced label' do
...@@ -481,12 +481,12 @@ describe Banzai::Filter::LabelReferenceFilter do ...@@ -481,12 +481,12 @@ describe Banzai::Filter::LabelReferenceFilter do
it 'has valid link text' do it 'has valid link text' do
expect(result.css('a').first.text) expect(result.css('a').first.text)
.to eq "#{group_label.name} in #{another_project.name_with_namespace}" .to eq "#{group_label.name} in #{another_project.full_name}"
end end
it 'has valid text' do it 'has valid text' do
expect(result.text) expect(result.text)
.to eq "See #{group_label.name} in #{another_project.name_with_namespace}" .to eq "See #{group_label.name} in #{another_project.full_name}"
end end
it 'ignores invalid IDs on the referenced label' do it 'ignores invalid IDs on the referenced label' do
......
...@@ -16,7 +16,7 @@ describe Gitlab::DataBuilder::Build do ...@@ -16,7 +16,7 @@ describe Gitlab::DataBuilder::Build do
it { expect(data[:build_status]).to eq(build.status) } it { expect(data[:build_status]).to eq(build.status) }
it { expect(data[:build_allow_failure]).to eq(false) } it { expect(data[:build_allow_failure]).to eq(false) }
it { expect(data[:project_id]).to eq(build.project.id) } it { expect(data[:project_id]).to eq(build.project.id) }
it { expect(data[:project_name]).to eq(build.project.name_with_namespace) } it { expect(data[:project_name]).to eq(build.project.full_name) }
context 'commit author_url' do context 'commit author_url' do
context 'when no commit present' do context 'when no commit present' do
......
...@@ -457,7 +457,7 @@ describe Notify do ...@@ -457,7 +457,7 @@ describe Notify do
it 'has the correct subject and body' do it 'has the correct subject and body' do
is_expected.to have_subject("#{project.name} | Project was moved") is_expected.to have_subject("#{project.name} | Project was moved")
is_expected.to have_html_escaped_body_text project.name_with_namespace is_expected.to have_html_escaped_body_text project.full_name
is_expected.to have_body_text(project.ssh_url_to_repo) is_expected.to have_body_text(project.ssh_url_to_repo)
end end
end end
...@@ -483,8 +483,8 @@ describe Notify do ...@@ -483,8 +483,8 @@ describe Notify do
to_emails = subject.header[:to].addrs.map(&:address) to_emails = subject.header[:to].addrs.map(&:address)
expect(to_emails).to eq([recipient.notification_email]) expect(to_emails).to eq([recipient.notification_email])
is_expected.to have_subject "Request to join the #{project.name_with_namespace} project" is_expected.to have_subject "Request to join the #{project.full_name} project"
is_expected.to have_html_escaped_body_text project.name_with_namespace is_expected.to have_html_escaped_body_text project.full_name
is_expected.to have_body_text project_project_members_url(project) is_expected.to have_body_text project_project_members_url(project)
is_expected.to have_body_text project_member.human_access is_expected.to have_body_text project_member.human_access
end end
...@@ -503,8 +503,8 @@ describe Notify do ...@@ -503,8 +503,8 @@ describe Notify do
it_behaves_like "a user cannot unsubscribe through footer link" it_behaves_like "a user cannot unsubscribe through footer link"
it 'contains all the useful information' do it 'contains all the useful information' do
is_expected.to have_subject "Access to the #{project.name_with_namespace} project was denied" is_expected.to have_subject "Access to the #{project.full_name} project was denied"
is_expected.to have_html_escaped_body_text project.name_with_namespace is_expected.to have_html_escaped_body_text project.full_name
is_expected.to have_body_text project.web_url is_expected.to have_body_text project.web_url
end end
end end
...@@ -520,8 +520,8 @@ describe Notify do ...@@ -520,8 +520,8 @@ describe Notify do
it_behaves_like "a user cannot unsubscribe through footer link" it_behaves_like "a user cannot unsubscribe through footer link"
it 'contains all the useful information' do it 'contains all the useful information' do
is_expected.to have_subject "Access to the #{project.name_with_namespace} project was granted" is_expected.to have_subject "Access to the #{project.full_name} project was granted"
is_expected.to have_html_escaped_body_text project.name_with_namespace is_expected.to have_html_escaped_body_text project.full_name
is_expected.to have_body_text project.web_url is_expected.to have_body_text project.web_url
is_expected.to have_body_text project_member.human_access is_expected.to have_body_text project_member.human_access
end end
...@@ -550,8 +550,8 @@ describe Notify do ...@@ -550,8 +550,8 @@ describe Notify do
it_behaves_like "a user cannot unsubscribe through footer link" it_behaves_like "a user cannot unsubscribe through footer link"
it 'contains all the useful information' do it 'contains all the useful information' do
is_expected.to have_subject "Invitation to join the #{project.name_with_namespace} project" is_expected.to have_subject "Invitation to join the #{project.full_name} project"
is_expected.to have_html_escaped_body_text project.name_with_namespace is_expected.to have_html_escaped_body_text project.full_name
is_expected.to have_body_text project.web_url is_expected.to have_body_text project.web_url
is_expected.to have_body_text project_member.human_access is_expected.to have_body_text project_member.human_access
is_expected.to have_body_text project_member.invite_token is_expected.to have_body_text project_member.invite_token
...@@ -575,7 +575,7 @@ describe Notify do ...@@ -575,7 +575,7 @@ describe Notify do
it 'contains all the useful information' do it 'contains all the useful information' do
is_expected.to have_subject 'Invitation accepted' is_expected.to have_subject 'Invitation accepted'
is_expected.to have_html_escaped_body_text project.name_with_namespace is_expected.to have_html_escaped_body_text project.full_name
is_expected.to have_body_text project.web_url is_expected.to have_body_text project.web_url
is_expected.to have_body_text project_member.invite_email is_expected.to have_body_text project_member.invite_email
is_expected.to have_html_escaped_body_text invited_user.name is_expected.to have_html_escaped_body_text invited_user.name
...@@ -598,7 +598,7 @@ describe Notify do ...@@ -598,7 +598,7 @@ describe Notify do
it 'contains all the useful information' do it 'contains all the useful information' do
is_expected.to have_subject 'Invitation declined' is_expected.to have_subject 'Invitation declined'
is_expected.to have_html_escaped_body_text project.name_with_namespace is_expected.to have_html_escaped_body_text project.full_name
is_expected.to have_body_text project.web_url is_expected.to have_body_text project.web_url
is_expected.to have_body_text project_member.invite_email is_expected.to have_body_text project_member.invite_email
end end
......
...@@ -47,7 +47,7 @@ describe AsanaService do ...@@ -47,7 +47,7 @@ describe AsanaService do
it 'calls Asana service to create a story' do it 'calls Asana service to create a story' do
data = create_data_for_commits('Message from commit. related to #123456') data = create_data_for_commits('Message from commit. related to #123456')
expected_message = "#{data[:user_name]} pushed to branch #{data[:ref]} of #{project.name_with_namespace} ( #{data[:commits][0][:url]} ): #{data[:commits][0][:message]}" expected_message = "#{data[:user_name]} pushed to branch #{data[:ref]} of #{project.full_name} ( #{data[:commits][0][:url]} ): #{data[:commits][0][:message]}"
d1 = double('Asana::Task') d1 = double('Asana::Task')
expect(d1).to receive(:add_comment).with(text: expected_message) expect(d1).to receive(:add_comment).with(text: expected_message)
......
...@@ -29,7 +29,7 @@ describe HipchatService do ...@@ -29,7 +29,7 @@ describe HipchatService do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :repository) } let(:project) { create(:project, :repository) }
let(:api_url) { 'https://hipchat.example.com/v2/room/123456/notification?auth_token=verySecret' } let(:api_url) { 'https://hipchat.example.com/v2/room/123456/notification?auth_token=verySecret' }
let(:project_name) { project.name_with_namespace.gsub(/\s/, '') } let(:project_name) { project.full_name.gsub(/\s/, '') }
let(:token) { 'verySecret' } let(:token) { 'verySecret' }
let(:server_url) { 'https://hipchat.example.com'} let(:server_url) { 'https://hipchat.example.com'}
let(:push_sample_data) do let(:push_sample_data) do
...@@ -303,7 +303,7 @@ describe HipchatService do ...@@ -303,7 +303,7 @@ describe HipchatService do
message = hipchat.__send__(:create_pipeline_message, data) message = hipchat.__send__(:create_pipeline_message, data)
project_url = project.web_url project_url = project.web_url
project_name = project.name_with_namespace.gsub(/\s/, '') project_name = project.full_name.gsub(/\s/, '')
pipeline_attributes = data[:object_attributes] pipeline_attributes = data[:object_attributes]
ref = pipeline_attributes[:ref] ref = pipeline_attributes[:ref]
ref_type = pipeline_attributes[:tag] ? 'tag' : 'branch' ref_type = pipeline_attributes[:tag] ? 'tag' : 'branch'
......
...@@ -31,10 +31,10 @@ describe MattermostSlashCommandsService do ...@@ -31,10 +31,10 @@ describe MattermostSlashCommandsService do
url: 'http://trigger.url', url: 'http://trigger.url',
icon_url: 'http://icon.url/icon.png', icon_url: 'http://icon.url/icon.png',
auto_complete: true, auto_complete: true,
auto_complete_desc: "Perform common operations on: #{project.name_with_namespace}", auto_complete_desc: "Perform common operations on: #{project.full_name}",
auto_complete_hint: '[help]', auto_complete_hint: '[help]',
description: "Perform common operations on: #{project.name_with_namespace}", description: "Perform common operations on: #{project.full_name}",
display_name: "GitLab / #{project.name_with_namespace}", display_name: "GitLab / #{project.full_name}",
method: 'P', method: 'P',
username: 'GitLab' username: 'GitLab'
}.to_json) }.to_json)
......
...@@ -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,
......
...@@ -25,7 +25,7 @@ describe Gitlab::GithubImport::ObjectImporter do ...@@ -25,7 +25,7 @@ describe Gitlab::GithubImport::ObjectImporter do
importer_class = double(:importer_class) importer_class = double(:importer_class)
importer_instance = double(:importer_instance) importer_instance = double(:importer_instance)
representation = double(:representation) representation = double(:representation)
project = double(:project, path_with_namespace: 'foo/bar') project = double(:project, full_path: 'foo/bar')
client = double(:client) client = double(:client)
expect(worker) expect(worker)
......
...@@ -5,7 +5,7 @@ describe Gitlab::GithubImport::ImportDiffNoteWorker do ...@@ -5,7 +5,7 @@ describe Gitlab::GithubImport::ImportDiffNoteWorker do
describe '#import' do describe '#import' do
it 'imports a diff note' do it 'imports a diff note' do
project = double(:project, path_with_namespace: 'foo/bar') project = double(:project, full_path: 'foo/bar')
client = double(:client) client = double(:client)
importer = double(:importer) importer = double(:importer)
hash = { hash = {
......
...@@ -5,7 +5,7 @@ describe Gitlab::GithubImport::ImportIssueWorker do ...@@ -5,7 +5,7 @@ describe Gitlab::GithubImport::ImportIssueWorker do
describe '#import' do describe '#import' do
it 'imports an issue' do it 'imports an issue' do
project = double(:project, path_with_namespace: 'foo/bar') project = double(:project, full_path: 'foo/bar')
client = double(:client) client = double(:client)
importer = double(:importer) importer = double(:importer)
hash = { hash = {
......
...@@ -5,7 +5,7 @@ describe Gitlab::GithubImport::ImportNoteWorker do ...@@ -5,7 +5,7 @@ describe Gitlab::GithubImport::ImportNoteWorker do
describe '#import' do describe '#import' do
it 'imports a note' do it 'imports a note' do
project = double(:project, path_with_namespace: 'foo/bar') project = double(:project, full_path: 'foo/bar')
client = double(:client) client = double(:client)
importer = double(:importer) importer = double(:importer)
hash = { hash = {
......
...@@ -5,7 +5,7 @@ describe Gitlab::GithubImport::ImportPullRequestWorker do ...@@ -5,7 +5,7 @@ describe Gitlab::GithubImport::ImportPullRequestWorker do
describe '#import' do describe '#import' do
it 'imports a pull request' do it 'imports a pull request' do
project = double(:project, path_with_namespace: 'foo/bar') project = double(:project, full_path: 'foo/bar')
client = double(:client) client = double(:client)
importer = double(:importer) importer = double(:importer)
hash = { hash = {
......
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