Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordixpac <dino.onex@gmail.com>2016-08-13 15:45:31 +0300
committerdixpac <dino.onex@gmail.com>2017-02-08 11:16:43 +0300
commit0dacf3c169a85e6f3a1c70f3f5e377d47f770d19 (patch)
tree9a7ceb14b6a7aa96636a4024df06fa37c782a3ee /spec/services/notes/destroy_service_spec.rb
parenta965edb89d3c260394ffc987832a469e7740415d (diff)
Fix inconsistent naming for services that delete things
* Changed name of delete_user_service and worker to destroy * Move and change delete_group_service to Groups::DestroyService * Rename Notes::DeleteService to Notes::DestroyService
Diffstat (limited to 'spec/services/notes/destroy_service_spec.rb')
-rw-r--r--spec/services/notes/destroy_service_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/services/notes/destroy_service_spec.rb b/spec/services/notes/destroy_service_spec.rb
new file mode 100644
index 00000000000..f53f96e0c2b
--- /dev/null
+++ b/spec/services/notes/destroy_service_spec.rb
@@ -0,0 +1,15 @@
+require 'spec_helper'
+
+describe Notes::DestroyService, services: true do
+ describe '#execute' do
+ it 'deletes a note' do
+ project = create(:empty_project)
+ issue = create(:issue, project: project)
+ note = create(:note, project: project, noteable: issue)
+
+ described_class.new(project, note.author).execute(note)
+
+ expect(project.issues.find(issue.id).notes).not_to include(note)
+ end
+ end
+end