2016-04-05 19:21:02 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2017-07-10 10:24:02 -04:00
|
|
|
describe Notes::DestroyService do
|
2016-04-05 19:21:02 -04:00
|
|
|
describe '#execute' do
|
|
|
|
it 'deletes a note' do
|
2017-08-02 15:55:11 -04:00
|
|
|
project = create(:project)
|
2016-04-12 09:43:29 -04:00
|
|
|
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
|