Commit 6c97d98e authored by Rajendra Kadam's avatar Rajendra Kadam

Add a test case for 404 and refactor docs as per feedback

parent f8f7eb04
# Error Tracking Settings API
# Error Tracking settings API
> [Introduced](https://gitlab.com/gitlab-org/gitlab/issues/34940) in GitLab 12.7.
## Error Tracking Project Settings
## Error Tracking project settings
The Project Settings API allows you to retrieve Error Tracking Settings for a Project. Only for project maintainers.
The project settings API allows you to retrieve the Error Tracking settings for a project. Only for project maintainers.
### Retrieve Error Tracking Settings
### Get Error Tracking settings
```
GET /projects/:id/error_tracking/settings
......@@ -14,7 +14,7 @@ GET /projects/:id/error_tracking/settings
| Attribute | Type | Required | Description |
| --------- | ------- | -------- | --------------------- |
| `id` | integer | yes | The ID of the project owned by the authenticated user |
| `id` | integer | yes | The ID or [URL-encoded path of the project](README.md#namespaced-path-encoding) owned by the authenticated user |
```bash
curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/error_tracking/settings
......
......@@ -10,6 +10,7 @@ module API
resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do
desc 'Get error tracking settings for the project' do
detail 'This feature was introduced in GitLab 12.7.'
success Entities::ErrorTracking::ProjectSetting
end
......
......@@ -29,6 +29,22 @@ describe API::ErrorTracking do
end
end
context 'without a project setting' do
let(:project) { create(:project) }
before do
project.add_maintainer(user)
end
it 'returns 404' do
make_request
expect(response).to have_gitlab_http_status(:not_found)
expect(json_response['message'])
.to eq('404 Error Tracking Setting Not Found')
end
end
context 'when authenticated as reporter' do
before do
project.add_reporter(user)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment