summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2017-06-29 17:43:11 +0000
committerRobert Speicher <robert@gitlab.com>2017-06-29 17:43:11 +0000
commit24972544636ba7c61e41946b5f04c1cd4d4efb26 (patch)
treeb4681ecaa54330cac6bfd7b321b4eef1cb7d47c1 /spec/models
parentd635114b9f03be7be272c0dd6c9ace47eb219483 (diff)
parentfa93156528bca4306e040a1b73720b6411942fcf (diff)
downloadgitlab-ce-24972544636ba7c61e41946b5f04c1cd4d4efb26.tar.gz
Merge branch 'sh-fix-project-destroy-in-namespace' into 'master'
Defer project destroys within a namespace in Groups::DestroyService#async_execute See merge request !12435
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/namespace_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/models/namespace_spec.rb b/spec/models/namespace_spec.rb
index d4f898f6d9f..62c4ea01ce1 100644
--- a/spec/models/namespace_spec.rb
+++ b/spec/models/namespace_spec.rb
@@ -342,6 +342,17 @@ describe Namespace, models: true do
end
end
+ describe '#soft_delete_without_removing_associations' do
+ let(:project1) { create(:project_empty_repo, namespace: namespace) }
+
+ it 'updates the deleted_at timestamp but preserves projects' do
+ namespace.soft_delete_without_removing_associations
+
+ expect(Project.all).to include(project1)
+ expect(namespace.deleted_at).not_to be_nil
+ end
+ end
+
describe '#user_ids_for_project_authorizations' do
it 'returns the user IDs for which to refresh authorizations' do
expect(namespace.user_ids_for_project_authorizations)