summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2017-04-19 10:15:52 +0200
committerJames Lopez <james@jameslopez.es>2017-04-19 10:15:52 +0200
commitd4861ec72d9b01abf19f1bcd6aa5afa7b7201578 (patch)
tree64a89a609607bbffe3947dd72c116981bf312226
parent1c6710e235e00d74b33c3712e2a981a8891d2a82 (diff)
downloadgitlab-ce-fix/orphan-notification-settings.tar.gz
add spec and changelogfix/orphan-notification-settings
-rw-r--r--changelogs/unreleased/fix-orphan-notification-settings.yml4
-rw-r--r--spec/services/groups/destroy_service_spec.rb2
2 files changed, 6 insertions, 0 deletions
diff --git a/changelogs/unreleased/fix-orphan-notification-settings.yml b/changelogs/unreleased/fix-orphan-notification-settings.yml
new file mode 100644
index 00000000000..7595b033336
--- /dev/null
+++ b/changelogs/unreleased/fix-orphan-notification-settings.yml
@@ -0,0 +1,4 @@
+---
+title: Removed orphaned notification settings without a namespace
+merge_request:
+author:
diff --git a/spec/services/groups/destroy_service_spec.rb b/spec/services/groups/destroy_service_spec.rb
index 2ee11fc8b4c..a37257d1bf4 100644
--- a/spec/services/groups/destroy_service_spec.rb
+++ b/spec/services/groups/destroy_service_spec.rb
@@ -7,6 +7,7 @@ describe Groups::DestroyService, services: true do
let!(:group) { create(:group) }
let!(:nested_group) { create(:group, parent: group) }
let!(:project) { create(:empty_project, namespace: group) }
+ let!(:notification_setting) { create(:notification_setting, source: group)}
let!(:gitlab_shell) { Gitlab::Shell.new }
let!(:remove_path) { group.path + "+#{group.id}+deleted" }
@@ -23,6 +24,7 @@ describe Groups::DestroyService, services: true do
it { expect(Group.unscoped.all).not_to include(group) }
it { expect(Group.unscoped.all).not_to include(nested_group) }
it { expect(Project.unscoped.all).not_to include(project) }
+ it { expect(NotificationSetting.unscoped.all).not_to include(notification_setting) }
end
context 'file system' do