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:
Diffstat (limited to 'spec/services/issues/close_service_spec.rb')
-rw-r--r--spec/services/issues/close_service_spec.rb23
1 files changed, 19 insertions, 4 deletions
diff --git a/spec/services/issues/close_service_spec.rb b/spec/services/issues/close_service_spec.rb
index 6fc1928d47b..78eba565de4 100644
--- a/spec/services/issues/close_service_spec.rb
+++ b/spec/services/issues/close_service_spec.rb
@@ -224,11 +224,26 @@ describe Issues::CloseService do
expect(email.subject).to include(issue.title)
end
- it 'creates system note about issue reassign' do
- close_issue
+ context 'when resource state events are disabled' do
+ before do
+ stub_feature_flags(track_resource_state_change_events: false)
+ end
+
+ it 'creates system note about the issue being closed' do
+ close_issue
+
+ note = issue.notes.last
+ expect(note.note).to include "closed"
+ end
+ end
- note = issue.notes.last
- expect(note.note).to include "closed"
+ context 'when resource state events are enabled' do
+ it 'creates resource state event about the issue being closed' do
+ close_issue
+
+ event = issue.resource_state_events.last
+ expect(event.state).to eq('closed')
+ end
end
it 'marks todos as done' do