diff options
Diffstat (limited to 'spec/services/incident_management/timeline_events/destroy_service_spec.rb')
-rw-r--r-- | spec/services/incident_management/timeline_events/destroy_service_spec.rb | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/spec/services/incident_management/timeline_events/destroy_service_spec.rb b/spec/services/incident_management/timeline_events/destroy_service_spec.rb index 09026f87116..e1b258960ae 100644 --- a/spec/services/incident_management/timeline_events/destroy_service_spec.rb +++ b/spec/services/incident_management/timeline_events/destroy_service_spec.rb @@ -48,10 +48,10 @@ RSpec.describe IncidentManagement::TimelineEvents::DestroyService do timeline_event.errors.add(:note, 'cannot be removed') end - it_behaves_like 'error response', 'Note cannot be removed' + it_behaves_like 'error response', 'Timeline text cannot be removed' end - context 'success response' do + context 'with success response' do it 'successfully returns the timeline event', :aggregate_failures do expect(execute).to be_success @@ -60,27 +60,11 @@ RSpec.describe IncidentManagement::TimelineEvents::DestroyService do expect(result.id).to eq(timeline_event.id) end - it_behaves_like 'an incident management tracked event', :incident_management_timeline_event_deleted - end - - context 'when incident_timeline feature flag is enabled' do - before do - stub_feature_flags(incident_timeline: project) - end - it 'creates a system note' do expect { execute }.to change { incident.notes.reload.count }.by(1) end - end - - context 'when incident_timeline feature flag is disabled' do - before do - stub_feature_flags(incident_timeline: false) - end - it 'does not create a system note' do - expect { execute }.not_to change { incident.notes.reload.count } - end + it_behaves_like 'an incident management tracked event', :incident_management_timeline_event_deleted end end end |