summaryrefslogtreecommitdiff
path: root/spec/services
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-02-19 00:09:15 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-02-19 00:09:15 +0000
commit60f63d15794e62c4bac9756445f618cd9acb8654 (patch)
tree30c2b2dc678995dd332b32672f9faa460fabdb79 /spec/services
parent93d7441cc98c1db55797a2181a3d9f4b3d26d82c (diff)
downloadgitlab-ce-60f63d15794e62c4bac9756445f618cd9acb8654.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services')
-rw-r--r--spec/services/incident_management/create_issue_service_spec.rb13
1 files changed, 7 insertions, 6 deletions
diff --git a/spec/services/incident_management/create_issue_service_spec.rb b/spec/services/incident_management/create_issue_service_spec.rb
index e720aafb897..4c7fb682193 100644
--- a/spec/services/incident_management/create_issue_service_spec.rb
+++ b/spec/services/incident_management/create_issue_service_spec.rb
@@ -4,7 +4,7 @@ require 'spec_helper'
describe IncidentManagement::CreateIssueService do
let(:project) { create(:project, :repository, :private) }
- let(:user) { User.alert_bot }
+ let_it_be(:user) { User.alert_bot }
let(:service) { described_class.new(project, alert_payload) }
let(:alert_starts_at) { Time.now }
let(:alert_title) { 'TITLE' }
@@ -29,7 +29,6 @@ describe IncidentManagement::CreateIssueService do
context 'when create_issue enabled' do
let(:issue) { subject[:issue] }
- let(:summary_separator) { "\n---\n\n" }
before do
setting.update!(create_issue: true)
@@ -42,7 +41,7 @@ describe IncidentManagement::CreateIssueService do
expect(issue.author).to eq(user)
expect(issue.title).to eq(alert_title)
expect(issue.description).to include(alert_presenter.issue_summary_markdown.strip)
- expect(separator_count(issue.description)).to eq 0
+ expect(separator_count(issue.description)).to eq(0)
end
end
@@ -74,7 +73,7 @@ describe IncidentManagement::CreateIssueService do
expect(subject).to include(status: :success)
expect(issue.description).to include(alert_presenter.issue_summary_markdown)
- expect(separator_count(issue.description)).to eq 1
+ expect(separator_count(issue.description)).to eq(1)
expect(issue.description).to include(template_content)
end
end
@@ -134,7 +133,7 @@ describe IncidentManagement::CreateIssueService do
expect(issue.description).to include(alert_presenter.issue_summary_markdown)
expect(issue.description).to include(template_content)
expect(issue.description).to include(alt_template)
- expect(separator_count(issue.description)).to eq 2
+ expect(separator_count(issue.description)).to eq(2)
end
end
@@ -171,7 +170,7 @@ describe IncidentManagement::CreateIssueService do
expect(issue.title).to include(query_title)
expect(issue.title).to include('for 5 minutes')
expect(issue.description).to include(alert_presenter.issue_summary_markdown.strip)
- expect(separator_count(issue.description)).to eq 0
+ expect(separator_count(issue.description)).to eq(0)
end
end
@@ -306,6 +305,8 @@ describe IncidentManagement::CreateIssueService do
end
def separator_count(text)
+ summary_separator = "\n\n---\n\n"
+
text.scan(summary_separator).size
end
end