From 0dacf3c169a85e6f3a1c70f3f5e377d47f770d19 Mon Sep 17 00:00:00 2001 From: dixpac Date: Sat, 13 Aug 2016 14:45:31 +0200 Subject: 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 --- spec/services/notes/destroy_service_spec.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 spec/services/notes/destroy_service_spec.rb (limited to 'spec/services/notes/destroy_service_spec.rb') 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 -- cgit v1.2.3