diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-18 14:18:50 +0300 |
commit | 8c7f4e9d5f36cff46365a7f8c4b9c21578c1e781 (patch) | |
tree | a77e7fe7a93de11213032ed4ab1f33a3db51b738 /spec/lib/gitlab/email | |
parent | 00b35af3db1abfe813a778f643dad221aad51fca (diff) |
Add latest changes from gitlab-org/gitlab@13-1-stable-ee
Diffstat (limited to 'spec/lib/gitlab/email')
-rw-r--r-- | spec/lib/gitlab/email/handler/create_note_handler_spec.rb | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/spec/lib/gitlab/email/handler/create_note_handler_spec.rb b/spec/lib/gitlab/email/handler/create_note_handler_spec.rb index 909a7618df4..af963e1b695 100644 --- a/spec/lib/gitlab/email/handler/create_note_handler_spec.rb +++ b/spec/lib/gitlab/email/handler/create_note_handler_spec.rb @@ -65,16 +65,24 @@ describe Gitlab::Email::Handler::CreateNoteHandler do end end - context 'and current user can update noteable' do - before do - project.add_developer(user) - end - - it 'does not raise an error' do - # One system note is created for the 'close' event - expect { receiver.execute }.to change { noteable.notes.count }.by(1) - - expect(noteable.reload).to be_closed + [true, false].each do |state_tracking_enabled| + context "and current user can update noteable #{state_tracking_enabled ? 'enabled' : 'disabled'}" do + before do + stub_feature_flags(track_resource_state_change_events: state_tracking_enabled) + + project.add_developer(user) + end + + it 'does not raise an error' do + if state_tracking_enabled + expect { receiver.execute }.to change { noteable.resource_state_events.count }.by(1) + else + # One system note is created for the 'close' event + expect { receiver.execute }.to change { noteable.notes.count }.by(1) + end + + expect(noteable.reload).to be_closed + end end end end |