2016-04-05 19:21:02 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2016-08-13 08:45:31 -04:00
|
|
|
describe Notes::DestroyService, services: true do
|
2016-04-05 19:21:02 -04:00
|
|
|
describe '#execute' do
|
|
|
|
it 'deletes a note' do
|
2016-04-12 09:43:29 -04:00
|
|
|
project = create(:empty_project)
|
|
|
|
issue = create(:issue, project: project)
|
|
|
|
note = create(:note, project: project, noteable: issue)
|
|
|
|
|
2016-04-06 13:04:17 -04:00
|
|
|
described_class.new(project, note.author).execute(note)
|
|
|
|
|
|
|
|
expect(project.issues.find(issue.id).notes).not_to include(note)
|
2016-04-05 19:21:02 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|