diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 13:00:54 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-20 13:00:54 +0300 |
commit | 3cccd102ba543e02725d247893729e5c73b38295 (patch) | |
tree | f36a04ec38517f5deaaacb5acc7d949688d1e187 /spec/services/issues/update_service_spec.rb | |
parent | 205943281328046ef7b4528031b90fbda70c75ac (diff) |
Add latest changes from gitlab-org/gitlab@14-10-stable-eev14.10.0-rc42
Diffstat (limited to 'spec/services/issues/update_service_spec.rb')
-rw-r--r-- | spec/services/issues/update_service_spec.rb | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/spec/services/issues/update_service_spec.rb b/spec/services/issues/update_service_spec.rb index 6d3c3dd4e39..d496857bb25 100644 --- a/spec/services/issues/update_service_spec.rb +++ b/spec/services/issues/update_service_spec.rb @@ -9,8 +9,8 @@ RSpec.describe Issues::UpdateService, :mailer do let_it_be(:guest) { create(:user) } let_it_be(:group) { create(:group, :public, :crm_enabled) } let_it_be(:project, reload: true) { create(:project, :repository, group: group) } - let_it_be(:label) { create(:label, project: project) } - let_it_be(:label2) { create(:label, project: project) } + let_it_be(:label) { create(:label, title: 'a', project: project) } + let_it_be(:label2) { create(:label, title: 'b', project: project) } let_it_be(:milestone) { create(:milestone, project: project) } let(:issue) do @@ -1224,6 +1224,18 @@ RSpec.describe Issues::UpdateService, :mailer do end context 'without an escalation status record' do + it 'creates a new record' do + expect { update_issue(opts) }.to change(::IncidentManagement::IssuableEscalationStatus, :count).by(1) + end + + it_behaves_like 'updates the escalation status record', :acknowledged + end + + context 'with :incident_escalations feature flag disabled' do + before do + stub_feature_flags(incident_escalations: false) + end + it_behaves_like 'does not change the status record' end end @@ -1349,6 +1361,19 @@ RSpec.describe Issues::UpdateService, :mailer do end end + context 'labels are updated' do + let(:label_a) { label } + let(:label_b) { label2 } + let(:issuable) { issue } + + it_behaves_like 'keeps issuable labels sorted after update' + it_behaves_like 'broadcasting issuable labels updates' + + def update_issuable(update_params) + update_issue(update_params) + end + end + it_behaves_like 'issuable record that supports quick actions' do let(:existing_issue) { create(:issue, project: project) } let(:issuable) { described_class.new(project: project, current_user: user, params: params).execute(existing_issue) } |