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
042b41ea
Commit
042b41ea
authored
Dec 22, 2019
by
raju249
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add specs for Error Tracking API
parent
c96d40aa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
0 deletions
+48
-0
changelogs/unreleased/error-tracking-api.yml
changelogs/unreleased/error-tracking-api.yml
+5
-0
spec/requests/api/error_tracking_spec.rb
spec/requests/api/error_tracking_spec.rb
+43
-0
No files found.
changelogs/unreleased/error-tracking-api.yml
0 → 100644
View file @
042b41ea
---
title
:
Add API for getting sentry error tracking settings of a project
merge_request
:
21788
author
:
type
:
added
spec/requests/api/error_tracking_spec.rb
0 → 100644
View file @
042b41ea
# frozen_string_literal: true
require
'spec_helper'
describe
API
::
ErrorTracking
do
describe
"GET sentry project settings"
do
let
(
:admin
)
{
create
(
:admin
)
}
let
(
:project_not_found_message
)
{
"404 Project Not Found"
}
let
(
:unauthorized_message
)
{
"401 Unauthorized"
}
let
(
:random_user
)
{
create
(
:user
)
}
let
(
:project_error_tracking_setting
)
{
create
(
:project_error_tracking_setting
)
}
let
(
:project
)
do
create
(
:project
,
:repository
,
creator:
admin
,
namespace:
admin
.
namespace
,
error_tracking_setting:
project_error_tracking_setting
)
end
context
'when user has permission to view settings'
do
it
'returns 200'
do
get
api
(
"/projects/
#{
project
.
id
}
/error_tracking/sentry_project_settings"
,
admin
)
expect
(
response
).
to
have_gitlab_http_status
(
200
)
expect
(
json_response
[
"project_name"
]).
to
eq
(
project_error_tracking_setting
.
project_name
)
expect
(
json_response
[
"sentry_external_url"
]).
to
eq
(
project_error_tracking_setting
.
sentry_external_url
)
end
end
context
'When user does not own the project'
do
it
'returns 404'
do
get
api
(
"/projects/
#{
project
.
id
}
/error_tracking/sentry_project_settings"
,
random_user
)
expect
(
response
).
to
have_gitlab_http_status
(
404
)
expect
(
json_response
[
"message"
]).
to
eq
(
project_not_found_message
)
end
end
context
'When unauthenticated'
do
it
'return 401'
do
get
api
(
"/projects/
#{
project
.
id
}
/error_tracking/sentry_project_settings"
)
expect
(
response
).
to
have_gitlab_http_status
(
401
)
expect
(
json_response
[
"message"
]).
to
eq
(
unauthorized_message
)
end
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