Commit 5694d9e5 authored by Rémy Coutable's avatar Rémy Coutable

Merge branch '29469-message-for-project-x-will-be-deleted-should-include-namespace' into 'master'

Display full project name with namespace upon deletion

Closes #29469

See merge request !9955
parents 253b61d2 3a6c7a2d
...@@ -117,7 +117,7 @@ class ProjectsController < Projects::ApplicationController ...@@ -117,7 +117,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[:alert] = "Project '#{@project.name}' will be deleted." flash[:alert] = "Project '#{@project.name_with_namespace}' will be deleted."
redirect_to dashboard_projects_path redirect_to dashboard_projects_path
rescue Projects::DestroyService::DestroyError => ex rescue Projects::DestroyService::DestroyError => ex
......
---
title: Display full project name with namespace upon deletion
merge_request:
author:
...@@ -56,7 +56,7 @@ feature 'Project', feature: true do ...@@ -56,7 +56,7 @@ feature 'Project', feature: true do
end end
describe 'removal', js: true do describe 'removal', js: true do
let(:user) { create(:user) } let(:user) { create(:user, username: 'test', name: 'test') }
let(:project) { create(:project, namespace: user.namespace, name: 'project1') } let(:project) { create(:project, namespace: user.namespace, name: 'project1') }
before do before do
...@@ -67,7 +67,7 @@ feature 'Project', feature: true do ...@@ -67,7 +67,7 @@ feature 'Project', feature: true do
it 'removes a project' do it 'removes a project' do
expect { remove_with_confirm('Remove project', project.path) }.to change {Project.count}.by(-1) expect { remove_with_confirm('Remove project', project.path) }.to change {Project.count}.by(-1)
expect(page).to have_content "Project 'project1' will be deleted." expect(page).to have_content "Project 'test / project1' will be deleted."
expect(Project.all.count).to be_zero expect(Project.all.count).to be_zero
expect(project.issues).to be_empty expect(project.issues).to be_empty
expect(project.merge_requests).to be_empty expect(project.merge_requests).to be_empty
......
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