summaryrefslogtreecommitdiff
path: root/spec/models/namespace_spec.rb
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2017-06-29 17:43:11 +0000
committerMichael Kozono <mkozono@gmail.com>2017-09-15 14:47:08 -0700
commit8cfdff180cd0fb5b6141ec8b2b7ad24294a735bd (patch)
tree10ec10038e90dd1ce7e291a290c46576a51f32ef /spec/models/namespace_spec.rb
parente3a6ab4e6543db37769106e4a87bb214205358f3 (diff)
downloadgitlab-ce-8cfdff180cd0fb5b6141ec8b2b7ad24294a735bd.tar.gz
Merge branch 'sh-fix-project-destroy-in-namespace' into 'master'mk-fix-orphaned-projects-on-9-2
Defer project destroys within a namespace in Groups::DestroyService#async_execute See merge request !12435
Diffstat (limited to 'spec/models/namespace_spec.rb')
-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 60ba8858df2..978fcb8f3a9 100644
--- a/spec/models/namespace_spec.rb
+++ b/spec/models/namespace_spec.rb
@@ -323,6 +323,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).