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
f6840649
Commit
f6840649
authored
Aug 31, 2021
by
Peter Leitzen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid use of `*_any_of_instance_of` in Sentry error request specs
This fixes offenses for RSpec/AnyInstanceOf for this file.
parent
c1edae68
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
19 deletions
+17
-19
.rubocop_manual_todo.yml
.rubocop_manual_todo.yml
+0
-1
spec/requests/api/graphql/project/error_tracking/sentry_errors_request_spec.rb
...phql/project/error_tracking/sentry_errors_request_spec.rb
+17
-18
No files found.
.rubocop_manual_todo.yml
View file @
f6840649
...
...
@@ -891,7 +891,6 @@ RSpec/AnyInstanceOf:
-
'
spec/requests/api/ci/runner/runners_verify_post_spec.rb'
-
'
spec/requests/api/graphql/gitlab_schema_spec.rb'
-
'
spec/requests/api/graphql/project/error_tracking/sentry_detailed_error_request_spec.rb'
-
'
spec/requests/api/graphql/project/error_tracking/sentry_errors_request_spec.rb'
-
'
spec/requests/api/graphql_spec.rb'
-
'
spec/requests/api/helpers_spec.rb'
-
'
spec/requests/api/internal/base_spec.rb'
...
...
spec/requests/api/graphql/project/error_tracking/sentry_errors_request_spec.rb
View file @
f6840649
...
...
@@ -3,6 +3,7 @@ require 'spec_helper'
RSpec
.
describe
'sentry errors requests'
do
include
GraphqlHelpers
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:project_setting
)
{
create
(
:project_error_tracking_setting
,
project:
project
)
}
let_it_be
(
:current_user
)
{
project
.
owner
}
...
...
@@ -50,9 +51,7 @@ RSpec.describe 'sentry errors requests' do
context
'when reactive cache returns data'
do
before
do
allow_any_instance_of
(
ErrorTracking
::
ProjectErrorTrackingSetting
)
.
to
receive
(
:issue_details
)
.
and_return
(
issue:
sentry_detailed_error
)
stub_setting_for
(
:issue_details
,
issue:
sentry_detailed_error
)
post_graphql
(
query
,
current_user:
current_user
)
end
...
...
@@ -83,9 +82,7 @@ RSpec.describe 'sentry errors requests' do
context
'when sentry api returns an error'
do
before
do
expect_any_instance_of
(
ErrorTracking
::
ProjectErrorTrackingSetting
)
.
to
receive
(
:issue_details
)
.
and_return
(
error:
'error message'
)
stub_setting_for
(
:issue_details
,
error:
'error message'
)
post_graphql
(
query
,
current_user:
current_user
)
end
...
...
@@ -142,9 +139,9 @@ RSpec.describe 'sentry errors requests' do
context
'when reactive cache returns data'
do
before
do
expect_any_instance_of
(
ErrorTracking
::
ProjectErrorTrackingSetting
)
.
to
receive
(
:list_sentry_issues
)
.
and_return
(
issues:
[
sentry_error
],
pagination:
pagination
)
stub_setting_for
(
:list_sentry_issues
,
issues:
[
sentry_error
],
pagination:
pagination
)
post_graphql
(
query
,
current_user:
current_user
)
end
...
...
@@ -179,9 +176,7 @@ RSpec.describe 'sentry errors requests' do
context
'when sentry api itself errors out'
do
before
do
expect_any_instance_of
(
ErrorTracking
::
ProjectErrorTrackingSetting
)
.
to
receive
(
:list_sentry_issues
)
.
and_return
(
error:
'error message'
)
stub_setting_for
(
:list_sentry_issues
,
error:
'error message'
)
post_graphql
(
query
,
current_user:
current_user
)
end
...
...
@@ -225,9 +220,7 @@ RSpec.describe 'sentry errors requests' do
context
'when reactive cache returns data'
do
before
do
allow_any_instance_of
(
ErrorTracking
::
ProjectErrorTrackingSetting
)
.
to
receive
(
:issue_latest_event
)
.
and_return
(
latest_event:
sentry_stack_trace
)
stub_setting_for
(
:issue_latest_event
,
latest_event:
sentry_stack_trace
)
post_graphql
(
query
,
current_user:
current_user
)
end
...
...
@@ -245,9 +238,7 @@ RSpec.describe 'sentry errors requests' do
context
'when sentry api returns an error'
do
before
do
expect_any_instance_of
(
ErrorTracking
::
ProjectErrorTrackingSetting
)
.
to
receive
(
:issue_latest_event
)
.
and_return
(
error:
'error message'
)
stub_setting_for
(
:issue_latest_event
,
error:
'error message'
)
post_graphql
(
query
,
current_user:
current_user
)
end
...
...
@@ -257,4 +248,12 @@ RSpec.describe 'sentry errors requests' do
end
end
end
private
def
stub_setting_for
(
method
,
**
return_value
)
allow_next_found_instance_of
(
ErrorTracking
::
ProjectErrorTrackingSetting
)
do
|
setting
|
allow
(
setting
).
to
receive
(
method
).
and_return
(
**
return_value
)
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