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
8409f860
Commit
8409f860
authored
Jun 05, 2020
by
syasonik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Exercise safe navigator and reduce chance of false positive
parent
631b3f2a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
ee/spec/services/status_page/mark_for_publication_service_spec.rb
...services/status_page/mark_for_publication_service_spec.rb
+16
-4
No files found.
ee/spec/services/status_page/mark_for_publication_service_spec.rb
View file @
8409f860
...
...
@@ -21,7 +21,12 @@ RSpec.describe StatusPage::MarkForPublicationService do
shared_examples
'does not track the incident'
do
specify
{
expect
{
subject
}.
not_to
change
{
::
StatusPage
::
PublishedIncident
.
count
}
}
specify
{
expect
{
subject
}.
not_to
change
{
issue
.
notes
.
count
}
}
specify
{
expect
(
subject
).
to
be_error
}
it
'returns the exepected error state'
do
expect
(
Gitlab
::
ErrorTracking
).
not_to
receive
(
:track_exception
)
expect
(
subject
).
to
be_error
end
end
context
'when license is not available'
do
...
...
@@ -63,6 +68,12 @@ RSpec.describe StatusPage::MarkForPublicationService do
it_behaves_like
'does not track the incident'
end
context
'when user is not logged in'
do
let
(
:service
)
{
described_class
.
new
(
project
,
nil
,
issue
)
}
it_behaves_like
'does not track the incident'
end
context
'when user does not have permissions'
do
let
(
:service
)
{
described_class
.
new
(
project
,
create
(
:user
),
issue
)
}
...
...
@@ -76,12 +87,13 @@ RSpec.describe StatusPage::MarkForPublicationService do
allow
(
::
SystemNoteService
).
to
receive
(
:publish_issue_to_status_page
).
and_raise
(
error
)
end
it_behaves_like
'does not track the incident'
specify
{
expect
{
subject
}.
not_to
change
{
::
StatusPage
::
PublishedIncident
.
count
}
}
specify
{
expect
{
subject
}.
not_to
change
{
issue
.
notes
.
count
}
}
it
'reports the error to sentry'
do
it
're
turns the exepected error state and re
ports the error to sentry'
do
expect
(
Gitlab
::
ErrorTracking
).
to
receive
(
:track_exception
).
with
(
error
)
subject
expect
(
subject
).
to
be_error
end
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