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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-12-08 12:09:41 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-12-08 12:09:41 +0300
commit707742e59ca57d1f2ea00d65fa35a7b9a5ded398 (patch)
tree8dcb287cd941eab2acf6d62de519d1e915686175 /spec/services/issues
parenta0834ebcaa12d126a20e07b6502121e1dc58c9b9 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/issues')
-rw-r--r--spec/services/issues/create_service_spec.rb1
-rw-r--r--spec/services/issues/update_service_spec.rb43
2 files changed, 8 insertions, 36 deletions
diff --git a/spec/services/issues/create_service_spec.rb b/spec/services/issues/create_service_spec.rb
index eeac7fb9923..cc6a49fc4cf 100644
--- a/spec/services/issues/create_service_spec.rb
+++ b/spec/services/issues/create_service_spec.rb
@@ -63,6 +63,7 @@ RSpec.describe Issues::CreateService do
subject { issue }
it_behaves_like 'incident issue'
+ it_behaves_like 'has incident label'
it_behaves_like 'an incident management tracked event', :incident_management_incident_created
it 'does create an incident label' do
diff --git a/spec/services/issues/update_service_spec.rb b/spec/services/issues/update_service_spec.rb
index 55d6d5cfe2d..06a6a52bc41 100644
--- a/spec/services/issues/update_service_spec.rb
+++ b/spec/services/issues/update_service_spec.rb
@@ -99,31 +99,18 @@ RSpec.describe Issues::UpdateService, :mailer do
context 'when issue type is incident' do
let(:issue) { create(:incident, project: project) }
- it 'changes updates the severity' do
+ before do
update_issue(opts)
-
- expect(issue.severity).to eq('low')
- end
-
- it_behaves_like 'incident issue' do
- before do
- update_issue(opts)
- end
end
- context 'with existing incident label' do
- let_it_be(:incident_label) { create(:label, :incident, project: project) }
+ it_behaves_like 'incident issue'
- before do
- opts.delete(:label_ids) # don't override but retain existing labels
- issue.labels << incident_label
- end
+ it 'changes updates the severity' do
+ expect(issue.severity).to eq('low')
+ end
- it_behaves_like 'incident issue' do
- before do
- update_issue(opts)
- end
- end
+ it 'does not apply incident labels' do
+ expect(issue.labels).to match_array [label]
end
end
@@ -155,7 +142,6 @@ RSpec.describe Issues::UpdateService, :mailer do
context 'issue in incident type' do
let(:current_user) { user }
- let(:incident_label_attributes) { attributes_for(:label, :incident) }
before do
opts.merge!(issue_type: 'incident', confidential: true)
@@ -170,21 +156,6 @@ RSpec.describe Issues::UpdateService, :mailer do
subject
end
end
-
- it 'does create an incident label' do
- expect { subject }
- .to change { Label.where(incident_label_attributes).count }.by(1)
- end
-
- context 'when invalid' do
- before do
- opts.merge!(title: '')
- end
-
- it 'does not create an incident label prematurely' do
- expect { subject }.not_to change(Label, :count)
- end
- end
end
it 'updates open issue counter for assignees when issue is reassigned' do