Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
cc7a585e
Commit
cc7a585e
authored
Jul 19, 2019
by
syasonik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unify approach of separator assertions
parent
fc55e30d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
ee/spec/services/incident_management/create_issue_service_spec.rb
...services/incident_management/create_issue_service_spec.rb
+9
-5
No files found.
ee/spec/services/incident_management/create_issue_service_spec.rb
View file @
cc7a585e
...
...
@@ -28,7 +28,7 @@ describe IncidentManagement::CreateIssueService do
context
'when create_issue enabled'
do
let
(
:issue
)
{
subject
[
:issue
]
}
let
(
:summary_separator
)
{
"---
\n\n
"
}
let
(
:summary_separator
)
{
"
\n
---
\n\n
"
}
before
do
setting
.
update!
(
create_issue:
true
)
...
...
@@ -41,7 +41,7 @@ describe IncidentManagement::CreateIssueService do
expect
(
issue
.
author
).
to
eq
(
User
.
alert_bot
)
expect
(
issue
.
title
).
to
eq
(
alert_title
)
expect
(
issue
.
description
).
to
include
(
alert_presenter
.
issue_summary_markdown
)
expect
(
issue
.
description
).
not_to
include
(
summary_separator
)
expect
(
separator_count
(
issue
.
description
)).
to
eq
0
end
end
...
...
@@ -53,7 +53,7 @@ describe IncidentManagement::CreateIssueService do
expect
(
subject
).
to
include
(
status: :success
)
expect
(
issue
.
description
).
to
include
(
alert_presenter
.
issue_summary_markdown
)
expect
(
issue
.
description
).
to
include
(
summary_separator
)
expect
(
separator_count
(
issue
.
description
)).
to
eq
1
expect
(
issue
.
description
).
to
include
(
template_content
)
end
end
...
...
@@ -113,7 +113,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
(
issue
.
description
.
scan
(
summary_separator
).
size
).
to
eq
(
2
)
expect
(
separator_count
(
issue
.
description
)).
to
eq
2
end
end
...
...
@@ -150,7 +150,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
)
expect
(
issue
.
description
).
not_to
include
(
summary_separator
)
expect
(
separator_count
(
issue
.
description
)).
to
eq
0
end
end
...
...
@@ -206,4 +206,8 @@ describe IncidentManagement::CreateIssueService do
def
error_message
(
message
)
%{Cannot create incident issue for "#{project.full_name}": #{message}}
end
def
separator_count
(
text
)
text
.
scan
(
summary_separator
).
size
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment