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
a71b0626
Commit
a71b0626
authored
Dec 10, 2019
by
Vitali Tatarintev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract stub_sentry_request method
Extract stub_sentry_request into a SentryClientHelpers
parent
8b79e803
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
22 deletions
+18
-22
spec/lib/sentry/client/projects_spec.rb
spec/lib/sentry/client/projects_spec.rb
+2
-11
spec/lib/sentry/client_spec.rb
spec/lib/sentry/client_spec.rb
+2
-11
spec/support/helpers/sentry_client_helpers.rb
spec/support/helpers/sentry_client_helpers.rb
+14
-0
No files found.
spec/lib/sentry/client/projects_spec.rb
View file @
a71b0626
...
...
@@ -3,6 +3,8 @@
require
'spec_helper'
describe
Sentry
::
Client
::
Projects
do
include
SentryClientHelpers
let
(
:sentry_url
)
{
'https://sentrytest.gitlab.com/api/0/projects/sentry-org/sentry-project'
}
let
(
:token
)
{
'test-token'
}
let
(
:client
)
{
Sentry
::
Client
.
new
(
sentry_url
,
token
)
}
...
...
@@ -114,15 +116,4 @@ describe Sentry::Client::Projects do
it_behaves_like
'maps Sentry exceptions'
end
end
private
def
stub_sentry_request
(
url
,
body:
{},
status:
200
,
headers:
{})
stub_request
(
:get
,
url
)
.
to_return
(
status:
status
,
headers:
{
'Content-Type'
=>
'application/json'
}.
merge
(
headers
),
body:
body
.
to_json
)
end
end
spec/lib/sentry/client_spec.rb
View file @
a71b0626
...
...
@@ -3,6 +3,8 @@
require
'spec_helper'
describe
Sentry
::
Client
do
include
SentryClientHelpers
let
(
:sentry_url
)
{
'https://sentrytest.gitlab.com/api/0/projects/sentry-org/sentry-project'
}
let
(
:token
)
{
'test-token'
}
let
(
:default_httparty_options
)
do
...
...
@@ -216,15 +218,4 @@ describe Sentry::Client do
it_behaves_like
'issues has correct length'
,
1
end
end
private
def
stub_sentry_request
(
url
,
body:
{},
status:
200
,
headers:
{})
stub_request
(
:get
,
url
)
.
to_return
(
status:
status
,
headers:
{
'Content-Type'
=>
'application/json'
}.
merge
(
headers
),
body:
body
.
to_json
)
end
end
spec/support/helpers/sentry_client_helpers.rb
0 → 100644
View file @
a71b0626
# frozen_string_literal: true
module
SentryClientHelpers
private
def
stub_sentry_request
(
url
,
body:
{},
status:
200
,
headers:
{})
stub_request
(
:get
,
url
)
.
to_return
(
status:
status
,
headers:
{
'Content-Type'
=>
'application/json'
}.
merge
(
headers
),
body:
body
.
to_json
)
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