Skip to content
Snippets Groups Projects
Commit eb1f5a3e authored by GitLab Bot's avatar GitLab Bot
Browse files

Add latest changes from gitlab-org/gitlab@master

parent b304a723
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -76,7 +76,7 @@ describe API::Issues do
it 'returns issues statistics' do
get api("/issues_statistics", user), params: params
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['statistics']).not_to be_nil
expect(json_response['statistics']['counts']['all']).to eq counts[:all]
expect(json_response['statistics']['counts']['closed']).to eq counts[:closed]
Loading
Loading
@@ -89,39 +89,39 @@ describe API::Issues do
it 'returns an array of all issues' do
get api('/issues'), params: { scope: 'all' }
 
expect(response).to have_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response).to be_an Array
end
 
it 'returns authentication error without any scope' do
get api('/issues')
 
expect(response).to have_http_status(401)
expect(response).to have_gitlab_http_status(:unauthorized)
end
 
it 'returns authentication error when scope is assigned-to-me' do
get api('/issues'), params: { scope: 'assigned-to-me' }
 
expect(response).to have_http_status(401)
expect(response).to have_gitlab_http_status(:unauthorized)
end
 
it 'returns authentication error when scope is created-by-me' do
get api('/issues'), params: { scope: 'created-by-me' }
 
expect(response).to have_http_status(401)
expect(response).to have_gitlab_http_status(:unauthorized)
end
 
it 'returns an array of issues matching state in milestone' do
get api('/issues'), params: { milestone: 'foo', scope: 'all' }
 
expect(response).to have_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect_paginated_array_response([])
end
 
it 'returns an array of issues matching state in milestone' do
get api('/issues'), params: { milestone: milestone.title, scope: 'all' }
 
expect(response).to have_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect_paginated_array_response([issue.id, closed_issue.id])
end
 
Loading
Loading
@@ -129,19 +129,19 @@ describe API::Issues do
it 'returns authentication error without any scope' do
get api('/issues_statistics')
 
expect(response).to have_http_status(401)
expect(response).to have_gitlab_http_status(:unauthorized)
end
 
it 'returns authentication error when scope is assigned_to_me' do
get api('/issues_statistics'), params: { scope: 'assigned_to_me' }
 
expect(response).to have_http_status(401)
expect(response).to have_gitlab_http_status(:unauthorized)
end
 
it 'returns authentication error when scope is created_by_me' do
get api('/issues_statistics'), params: { scope: 'created_by_me' }
 
expect(response).to have_http_status(401)
expect(response).to have_gitlab_http_status(:unauthorized)
end
 
context 'no state is treated as all state' do
Loading
Loading
@@ -642,14 +642,14 @@ describe API::Issues do
it 'accepts only predefined order by params' do
API::Helpers::IssuesHelpers.sort_options.each do |sort_opt|
get api('/issues', user), params: { order_by: sort_opt, sort: 'asc' }
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
end
 
it 'fails to sort with non predefined options' do
%w(milestone title abracadabra).each do |sort_opt|
get api('/issues', user), params: { order_by: sort_opt, sort: 'asc' }
expect(response).to have_gitlab_http_status(400)
expect(response).to have_gitlab_http_status(:bad_request)
end
end
end
Loading
Loading
@@ -657,14 +657,14 @@ describe API::Issues do
it 'matches V4 response schema' do
get api('/issues', user)
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(response).to match_response_schema('public_api/v4/issues')
end
 
it 'returns a related merge request count of 0 if there are no related merge requests' do
get api('/issues', user)
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(response).to match_response_schema('public_api/v4/issues')
expect(json_response.first).to include('merge_requests_count' => 0)
end
Loading
Loading
@@ -674,7 +674,7 @@ describe API::Issues do
 
get api('/issues', user)
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(response).to match_response_schema('public_api/v4/issues')
expect(json_response.first).to include('merge_requests_count' => 1)
end
Loading
Loading
@@ -767,14 +767,14 @@ describe API::Issues do
it 'returns error when multiple assignees are passed' do
get api("/issues", user), params: { assignee_username: [assignee.username, another_assignee.username], scope: 'all' }
 
expect(response).to have_gitlab_http_status(400)
expect(response).to have_gitlab_http_status(:bad_request)
expect(json_response["error"]).to include("allows one value, but found 2")
end
 
it 'returns error when assignee_username and assignee_id are passed together' do
get api("/issues", user), params: { assignee_username: [assignee.username], assignee_id: another_assignee.id, scope: 'all' }
 
expect(response).to have_gitlab_http_status(400)
expect(response).to have_gitlab_http_status(:bad_request)
expect(json_response["error"]).to include("mutually exclusive")
end
end
Loading
Loading
@@ -835,7 +835,7 @@ describe API::Issues do
it 'exposes full reference path' do
get api("/projects/#{project.id}/issues/#{issue.iid}", user)
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['references']['short']).to eq("##{issue.iid}")
expect(json_response['references']['relative']).to eq("##{issue.iid}")
expect(json_response['references']['full']).to eq("#{project.parent.path}/#{project.path}##{issue.iid}")
Loading
Loading
@@ -845,12 +845,12 @@ describe API::Issues do
describe 'DELETE /projects/:id/issues/:issue_iid' do
it 'rejects a non member from deleting an issue' do
delete api("/projects/#{project.id}/issues/#{issue.iid}", non_member)
expect(response).to have_gitlab_http_status(403)
expect(response).to have_gitlab_http_status(:forbidden)
end
 
it 'rejects a developer from deleting an issue' do
delete api("/projects/#{project.id}/issues/#{issue.iid}", author)
expect(response).to have_gitlab_http_status(403)
expect(response).to have_gitlab_http_status(:forbidden)
end
 
context 'when the user is project owner' do
Loading
Loading
@@ -860,7 +860,7 @@ describe API::Issues do
it 'deletes the issue if an admin requests it' do
delete api("/projects/#{project.id}/issues/#{issue.iid}", owner)
 
expect(response).to have_gitlab_http_status(204)
expect(response).to have_gitlab_http_status(:no_content)
end
 
it_behaves_like '412 response' do
Loading
Loading
@@ -872,14 +872,14 @@ describe API::Issues do
it 'returns 404 when trying to delete an issue' do
delete api("/projects/#{project.id}/issues/123", user)
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
end
 
it 'returns 404 when using the issue ID instead of IID' do
delete api("/projects/#{project.id}/issues/#{issue.id}", user)
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
end
 
Loading
Loading
Loading
Loading
@@ -75,7 +75,7 @@ describe API::Issues do
post api("/projects/#{project.id}/issues", user),
params: { title: 'new issue', assignee_id: user2.id }
 
expect(response).to have_gitlab_http_status(201)
expect(response).to have_gitlab_http_status(:created)
expect(json_response['title']).to eq('new issue')
expect(json_response['assignee']['name']).to eq(user2.name)
expect(json_response['assignees'].first['name']).to eq(user2.name)
Loading
Loading
@@ -85,7 +85,7 @@ describe API::Issues do
post api("/projects/#{project.id}/issues", user),
params: { title: 'new issue', assignee_id: '' }
 
expect(response).to have_gitlab_http_status(201)
expect(response).to have_gitlab_http_status(:created)
expect(json_response['title']).to eq('new issue')
expect(json_response['assignee']).to be_nil
end
Loading
Loading
@@ -96,7 +96,7 @@ describe API::Issues do
post api("/projects/#{project.id}/issues", user),
params: { title: 'new issue', assignee_ids: [user2.id, guest.id] }
 
expect(response).to have_gitlab_http_status(201)
expect(response).to have_gitlab_http_status(:created)
expect(json_response['title']).to eq('new issue')
expect(json_response['assignees'].count).to eq(1)
end
Loading
Loading
@@ -112,7 +112,7 @@ describe API::Issues do
it 'renders 403' do
post api("/projects/#{project.id}/issues", not_member), params: { title: 'new issue' }
 
expect(response).to have_gitlab_http_status(403)
expect(response).to have_gitlab_http_status(:forbidden)
end
end
 
Loading
Loading
@@ -122,7 +122,7 @@ describe API::Issues do
post api("/projects/#{project.id}/issues", admin),
params: { title: 'new issue', iid: 9001 }
 
expect(response).to have_gitlab_http_status(201)
expect(response).to have_gitlab_http_status(:created)
expect(json_response['iid']).to eq 9001
end
end
Loading
Loading
@@ -132,7 +132,7 @@ describe API::Issues do
post api("/projects/#{project.id}/issues", user),
params: { title: 'new issue', iid: 9001 }
 
expect(response).to have_gitlab_http_status(201)
expect(response).to have_gitlab_http_status(:created)
expect(json_response['iid']).to eq 9001
end
end
Loading
Loading
@@ -146,7 +146,7 @@ describe API::Issues do
post api("/projects/#{group_project.id}/issues", user2),
params: { title: 'new issue', iid: 9001 }
 
expect(response).to have_gitlab_http_status(201)
expect(response).to have_gitlab_http_status(:created)
expect(json_response['iid']).to eq 9001
end
end
Loading
Loading
@@ -156,7 +156,7 @@ describe API::Issues do
post api("/projects/#{project.id}/issues", user2),
params: { title: 'new issue', iid: 9001 }
 
expect(response).to have_gitlab_http_status(201)
expect(response).to have_gitlab_http_status(:created)
expect(json_response['iid']).not_to eq 9001
end
end
Loading
Loading
@@ -166,7 +166,7 @@ describe API::Issues do
post api("/projects/#{project.id}/issues", admin),
params: { title: 'new issue', iid: issue.iid }
 
expect(response).to have_gitlab_http_status(409)
expect(response).to have_gitlab_http_status(:conflict)
expect(json_response['message']).to eq 'Duplicated issue'
end
end
Loading
Loading
@@ -176,7 +176,7 @@ describe API::Issues do
post api("/projects/#{project.id}/issues", user),
params: { title: 'new issue', labels: 'label, label2', weight: 3, assignee_ids: [user2.id] }
 
expect(response).to have_gitlab_http_status(201)
expect(response).to have_gitlab_http_status(:created)
expect(json_response['title']).to eq('new issue')
expect(json_response['description']).to be_nil
expect(json_response['labels']).to eq(%w(label label2))
Loading
Loading
@@ -189,7 +189,7 @@ describe API::Issues do
post api("/projects/#{project.id}/issues", user),
params: { title: 'new issue', labels: %w(label label2), weight: 3, assignee_ids: [user2.id] }
 
expect(response).to have_gitlab_http_status(201)
expect(response).to have_gitlab_http_status(:created)
expect(json_response['title']).to eq('new issue')
expect(json_response['description']).to be_nil
expect(json_response['labels']).to eq(%w(label label2))
Loading
Loading
@@ -202,7 +202,7 @@ describe API::Issues do
post api("/projects/#{project.id}/issues", user),
params: { title: 'new issue', confidential: true }
 
expect(response).to have_gitlab_http_status(201)
expect(response).to have_gitlab_http_status(:created)
expect(json_response['title']).to eq('new issue')
expect(json_response['confidential']).to be_truthy
end
Loading
Loading
@@ -211,7 +211,7 @@ describe API::Issues do
post api("/projects/#{project.id}/issues", user),
params: { title: 'new issue', confidential: 'y' }
 
expect(response).to have_gitlab_http_status(201)
expect(response).to have_gitlab_http_status(:created)
expect(json_response['title']).to eq('new issue')
expect(json_response['confidential']).to be_truthy
end
Loading
Loading
@@ -220,7 +220,7 @@ describe API::Issues do
post api("/projects/#{project.id}/issues", user),
params: { title: 'new issue', confidential: false }
 
expect(response).to have_gitlab_http_status(201)
expect(response).to have_gitlab_http_status(:created)
expect(json_response['title']).to eq('new issue')
expect(json_response['confidential']).to be_falsy
end
Loading
Loading
@@ -229,13 +229,13 @@ describe API::Issues do
post api("/projects/#{project.id}/issues", user),
params: { title: 'new issue', confidential: 'foo' }
 
expect(response).to have_gitlab_http_status(400)
expect(response).to have_gitlab_http_status(:bad_request)
expect(json_response['error']).to eq('confidential is invalid')
end
 
it 'returns a 400 bad request if title not given' do
post api("/projects/#{project.id}/issues", user), params: { labels: 'label, label2' }
expect(response).to have_gitlab_http_status(400)
expect(response).to have_gitlab_http_status(:bad_request)
end
 
it 'allows special label names' do
Loading
Loading
@@ -269,7 +269,7 @@ describe API::Issues do
it 'returns 400 if title is too long' do
post api("/projects/#{project.id}/issues", user),
params: { title: 'g' * 256 }
expect(response).to have_gitlab_http_status(400)
expect(response).to have_gitlab_http_status(:bad_request)
expect(json_response['message']['title']).to eq([
'is too long (maximum is 255 characters)'
])
Loading
Loading
@@ -317,7 +317,7 @@ describe API::Issues do
post api("/projects/#{project.id}/issues", user),
params: { title: 'new issue', due_date: due_date }
 
expect(response).to have_gitlab_http_status(201)
expect(response).to have_gitlab_http_status(:created)
expect(json_response['title']).to eq('new issue')
expect(json_response['description']).to be_nil
expect(json_response['due_date']).to eq(due_date)
Loading
Loading
@@ -332,7 +332,7 @@ describe API::Issues do
it 'sets the creation time on the new issue' do
post api("/projects/#{project.id}/issues", admin), params: params
 
expect(response).to have_gitlab_http_status(201)
expect(response).to have_gitlab_http_status(:created)
expect(Time.parse(json_response['created_at'])).to be_like_time(creation_time)
end
end
Loading
Loading
@@ -341,7 +341,7 @@ describe API::Issues do
it 'sets the creation time on the new issue' do
post api("/projects/#{project.id}/issues", user), params: params
 
expect(response).to have_gitlab_http_status(201)
expect(response).to have_gitlab_http_status(:created)
expect(Time.parse(json_response['created_at'])).to be_like_time(creation_time)
end
end
Loading
Loading
@@ -353,7 +353,7 @@ describe API::Issues do
group.add_owner(user2)
post api("/projects/#{group_project.id}/issues", user2), params: params
 
expect(response).to have_gitlab_http_status(201)
expect(response).to have_gitlab_http_status(:created)
expect(Time.parse(json_response['created_at'])).to be_like_time(creation_time)
end
end
Loading
Loading
@@ -362,7 +362,7 @@ describe API::Issues do
it 'ignores the given creation time' do
post api("/projects/#{project.id}/issues", user2), params: params
 
expect(response).to have_gitlab_http_status(201)
expect(response).to have_gitlab_http_status(:created)
expect(Time.parse(json_response['created_at'])).not_to be_like_time(creation_time)
end
end
Loading
Loading
@@ -417,7 +417,7 @@ describe API::Issues do
it 'returns correct status and message' do
post_issue
 
expect(response).to have_gitlab_http_status(400)
expect(response).to have_gitlab_http_status(:bad_request)
expect(json_response['message']).to eq({ 'error' => 'Spam detected' })
end
 
Loading
Loading
@@ -435,7 +435,7 @@ describe API::Issues do
it 'returns correct status' do
post_issue
 
expect(response).to have_gitlab_http_status(201)
expect(response).to have_gitlab_http_status(:created)
end
 
it 'creates a new spam log entry' do
Loading
Loading
@@ -453,7 +453,7 @@ describe API::Issues do
post api("/projects/#{project.id}/issues/#{issue.iid}/move", user),
params: { to_project_id: target_project.id }
 
expect(response).to have_gitlab_http_status(201)
expect(response).to have_gitlab_http_status(:created)
expect(json_response['project_id']).to eq(target_project.id)
end
 
Loading
Loading
@@ -462,7 +462,7 @@ describe API::Issues do
post api("/projects/#{project.id}/issues/#{issue.iid}/move", user),
params: { to_project_id: project.id }
 
expect(response).to have_gitlab_http_status(400)
expect(response).to have_gitlab_http_status(:bad_request)
expect(json_response['message']).to eq(s_('MoveIssue|Cannot move issue to project it originates from!'))
end
end
Loading
Loading
@@ -472,7 +472,7 @@ describe API::Issues do
post api("/projects/#{project.id}/issues/#{issue.iid}/move", user),
params: { to_project_id: target_project2.id }
 
expect(response).to have_gitlab_http_status(400)
expect(response).to have_gitlab_http_status(:bad_request)
expect(json_response['message']).to eq(s_('MoveIssue|Cannot move issue due to insufficient permissions!'))
end
end
Loading
Loading
@@ -481,7 +481,7 @@ describe API::Issues do
post api("/projects/#{project.id}/issues/#{issue.iid}/move", admin),
params: { to_project_id: target_project2.id }
 
expect(response).to have_gitlab_http_status(201)
expect(response).to have_gitlab_http_status(:created)
expect(json_response['project_id']).to eq(target_project2.id)
end
 
Loading
Loading
@@ -490,7 +490,7 @@ describe API::Issues do
post api("/projects/#{project.id}/issues/#{issue.id}/move", user),
params: { to_project_id: target_project.id }
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
expect(json_response['message']).to eq('404 Issue Not Found')
end
end
Loading
Loading
@@ -500,7 +500,7 @@ describe API::Issues do
post api("/projects/#{project.id}/issues/123/move", user),
params: { to_project_id: target_project.id }
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
expect(json_response['message']).to eq('404 Issue Not Found')
end
end
Loading
Loading
@@ -510,7 +510,7 @@ describe API::Issues do
post api("/projects/0/issues/#{issue.iid}/move", user),
params: { to_project_id: target_project.id }
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
expect(json_response['message']).to eq('404 Project Not Found')
end
end
Loading
Loading
@@ -520,7 +520,7 @@ describe API::Issues do
post api("/projects/#{project.id}/issues/#{issue.iid}/move", user),
params: { to_project_id: 0 }
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
end
end
Loading
Loading
@@ -529,32 +529,32 @@ describe API::Issues do
it 'subscribes to an issue' do
post api("/projects/#{project.id}/issues/#{issue.iid}/subscribe", user2)
 
expect(response).to have_gitlab_http_status(201)
expect(response).to have_gitlab_http_status(:created)
expect(json_response['subscribed']).to eq(true)
end
 
it 'returns 304 if already subscribed' do
post api("/projects/#{project.id}/issues/#{issue.iid}/subscribe", user)
 
expect(response).to have_gitlab_http_status(304)
expect(response).to have_gitlab_http_status(:not_modified)
end
 
it 'returns 404 if the issue is not found' do
post api("/projects/#{project.id}/issues/123/subscribe", user)
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
 
it 'returns 404 if the issue ID is used instead of the iid' do
post api("/projects/#{project.id}/issues/#{issue.id}/subscribe", user)
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
 
it 'returns 404 if the issue is confidential' do
post api("/projects/#{project.id}/issues/#{confidential_issue.iid}/subscribe", non_member)
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
end
 
Loading
Loading
@@ -562,32 +562,32 @@ describe API::Issues do
it 'unsubscribes from an issue' do
post api("/projects/#{project.id}/issues/#{issue.iid}/unsubscribe", user)
 
expect(response).to have_gitlab_http_status(201)
expect(response).to have_gitlab_http_status(:created)
expect(json_response['subscribed']).to eq(false)
end
 
it 'returns 304 if not subscribed' do
post api("/projects/#{project.id}/issues/#{issue.iid}/unsubscribe", user2)
 
expect(response).to have_gitlab_http_status(304)
expect(response).to have_gitlab_http_status(:not_modified)
end
 
it 'returns 404 if the issue is not found' do
post api("/projects/#{project.id}/issues/123/unsubscribe", user)
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
 
it 'returns 404 if using the issue ID instead of iid' do
post api("/projects/#{project.id}/issues/#{issue.id}/unsubscribe", user)
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
 
it 'returns 404 if the issue is confidential' do
post api("/projects/#{project.id}/issues/#{confidential_issue.iid}/unsubscribe", non_member)
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
end
end
Loading
Loading
@@ -73,7 +73,7 @@ describe API::Issues do
it 'updates a project issue' do
put api("/projects/#{project.id}/issues/#{issue.iid}", user),
params: { title: 'updated title' }
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
 
expect(json_response['title']).to eq('updated title')
end
Loading
Loading
@@ -81,13 +81,13 @@ describe API::Issues do
it 'returns 404 error if issue iid not found' do
put api("/projects/#{project.id}/issues/44444", user),
params: { title: 'updated title' }
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
 
it 'returns 404 error if issue id is used instead of the iid' do
put api("/projects/#{project.id}/issues/#{issue.id}", user),
params: { title: 'updated title' }
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
 
it 'allows special label names' do
Loading
Loading
@@ -124,33 +124,33 @@ describe API::Issues do
it 'returns 403 for non project members' do
put api("/projects/#{project.id}/issues/#{confidential_issue.iid}", non_member),
params: { title: 'updated title' }
expect(response).to have_gitlab_http_status(403)
expect(response).to have_gitlab_http_status(:forbidden)
end
 
it 'returns 403 for project members with guest role' do
put api("/projects/#{project.id}/issues/#{confidential_issue.iid}", guest),
params: { title: 'updated title' }
expect(response).to have_gitlab_http_status(403)
expect(response).to have_gitlab_http_status(:forbidden)
end
 
it 'updates a confidential issue for project members' do
put api("/projects/#{project.id}/issues/#{confidential_issue.iid}", user),
params: { title: 'updated title' }
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['title']).to eq('updated title')
end
 
it 'updates a confidential issue for author' do
put api("/projects/#{project.id}/issues/#{confidential_issue.iid}", author),
params: { title: 'updated title' }
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['title']).to eq('updated title')
end
 
it 'updates a confidential issue for admin' do
put api("/projects/#{project.id}/issues/#{confidential_issue.iid}", admin),
params: { title: 'updated title' }
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['title']).to eq('updated title')
end
 
Loading
Loading
@@ -158,7 +158,7 @@ describe API::Issues do
put api("/projects/#{project.id}/issues/#{issue.iid}", user),
params: { confidential: true }
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['confidential']).to be_truthy
end
 
Loading
Loading
@@ -166,7 +166,7 @@ describe API::Issues do
put api("/projects/#{project.id}/issues/#{confidential_issue.iid}", user),
params: { confidential: false }
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['confidential']).to be_falsy
end
 
Loading
Loading
@@ -174,7 +174,7 @@ describe API::Issues do
put api("/projects/#{project.id}/issues/#{confidential_issue.iid}", user),
params: { confidential: 'foo' }
 
expect(response).to have_gitlab_http_status(400)
expect(response).to have_gitlab_http_status(:bad_request)
expect(json_response['error']).to eq('confidential is invalid')
end
end
Loading
Loading
@@ -214,7 +214,7 @@ describe API::Issues do
it 'returns correct status and message' do
update_issue
 
expect(response).to have_gitlab_http_status(400)
expect(response).to have_gitlab_http_status(:bad_request)
expect(json_response).to include('message' => { 'error' => 'Spam detected' })
end
 
Loading
Loading
@@ -232,7 +232,7 @@ describe API::Issues do
it 'returns correct status and message' do
update_issue
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
end
 
it 'creates a new spam log entry' do
Loading
Loading
@@ -248,7 +248,7 @@ describe API::Issues do
put api("/projects/#{project.id}/issues/#{issue.iid}", user),
params: { assignee_id: 0 }
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
 
expect(json_response['assignee']).to be_nil
end
Loading
Loading
@@ -257,7 +257,7 @@ describe API::Issues do
put api("/projects/#{project.id}/issues/#{issue.iid}", user),
params: { assignee_id: user2.id }
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
 
expect(json_response['assignee']['name']).to eq(user2.name)
end
Loading
Loading
@@ -267,7 +267,7 @@ describe API::Issues do
put api("/projects/#{project.id}/issues/#{issue.iid}", user),
params: { assignee_ids: [0] }
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
 
expect(json_response['assignees']).to be_empty
end
Loading
Loading
@@ -276,7 +276,7 @@ describe API::Issues do
put api("/projects/#{project.id}/issues/#{issue.iid}", user),
params: { assignee_ids: [user2.id] }
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
 
expect(json_response['assignees'].first['name']).to eq(user2.name)
end
Loading
Loading
@@ -286,7 +286,7 @@ describe API::Issues do
put api("/projects/#{project.id}/issues/#{issue.iid}", user),
params: { assignee_ids: [user2.id, guest.id] }
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
 
expect(json_response['assignees'].size).to eq(1)
end
Loading
Loading
@@ -300,7 +300,7 @@ describe API::Issues do
it 'does not update labels if not present' do
put api("/projects/#{project.id}/issues/#{issue.iid}", user),
params: { title: 'updated title' }
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['labels']).to eq([label.title])
end
 
Loading
Loading
@@ -309,7 +309,7 @@ describe API::Issues do
put api("/projects/#{project.id}/issues/#{issue.iid}", user), params: { labels: '' }
end
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['labels']).to eq([])
expect(json_response['updated_at']).to be > Time.now
end
Loading
Loading
@@ -319,7 +319,7 @@ describe API::Issues do
put api("/projects/#{project.id}/issues/#{issue.iid}", user), params: { labels: [''] }
end
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['labels']).to eq([])
expect(json_response['updated_at']).to be > Time.now
end
Loading
Loading
@@ -329,7 +329,7 @@ describe API::Issues do
put api("/projects/#{project.id}/issues/#{issue.iid}", user),
params: { labels: 'foo,bar' }
end
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['labels']).to include 'foo'
expect(json_response['labels']).to include 'bar'
expect(json_response['updated_at']).to be > Time.now
Loading
Loading
@@ -340,7 +340,7 @@ describe API::Issues do
put api("/projects/#{project.id}/issues/#{issue.iid}", user),
params: { labels: %w(foo bar) }
end
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['labels']).to include 'foo'
expect(json_response['labels']).to include 'bar'
expect(json_response['updated_at']).to be > Time.now
Loading
Loading
@@ -377,7 +377,7 @@ describe API::Issues do
it 'returns 400 if title is too long' do
put api("/projects/#{project.id}/issues/#{issue.iid}", user),
params: { title: 'g' * 256 }
expect(response).to have_gitlab_http_status(400)
expect(response).to have_gitlab_http_status(:bad_request)
expect(json_response['message']['title']).to eq([
'is too long (maximum is 255 characters)'
])
Loading
Loading
@@ -388,7 +388,7 @@ describe API::Issues do
it 'updates a project issue' do
put api("/projects/#{project.id}/issues/#{issue.iid}", user),
params: { labels: 'label2', state_event: 'close' }
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
 
expect(json_response['labels']).to include 'label2'
expect(json_response['state']).to eq 'closed'
Loading
Loading
@@ -397,7 +397,7 @@ describe API::Issues do
it 'reopens a project isssue' do
put api("/projects/#{project.id}/issues/#{closed_issue.iid}", user), params: { state_event: 'reopen' }
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['state']).to eq 'opened'
end
 
Loading
Loading
@@ -407,7 +407,7 @@ describe API::Issues do
put api("/projects/#{project.id}/issues/#{issue.iid}", user),
params: { labels: 'label3', state_event: 'close', updated_at: update_time }
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['labels']).to include 'label3'
expect(Time.parse(json_response['updated_at'])).to be_like_time(update_time)
end
Loading
Loading
@@ -420,7 +420,7 @@ describe API::Issues do
 
put api("/projects/#{project.id}/issues/#{issue.iid}", user), params: { due_date: due_date }
 
expect(response).to have_gitlab_http_status(200)
expect(response).to have_gitlab_http_status(:ok)
expect(json_response['due_date']).to eq(due_date)
end
end
Loading
Loading
Loading
Loading
@@ -32,7 +32,7 @@ describe API::Pages do
it 'returns 204' do
delete api("/projects/#{project.id}/pages", admin)
 
expect(response).to have_gitlab_http_status(204)
expect(response).to have_gitlab_http_status(:no_content)
end
 
it 'removes the pages' do
Loading
Loading
@@ -53,7 +53,7 @@ describe API::Pages do
it 'returns 204' do
delete api("/projects/#{project.id}/pages", admin)
 
expect(response).to have_gitlab_http_status(204)
expect(response).to have_gitlab_http_status(:no_content)
end
end
 
Loading
Loading
@@ -63,7 +63,7 @@ describe API::Pages do
 
delete api("/projects/#{id}/pages", admin)
 
expect(response).to have_gitlab_http_status(404)
expect(response).to have_gitlab_http_status(:not_found)
end
end
end
Loading
Loading
Loading
Loading
@@ -76,6 +76,7 @@ describe SubmitUsagePingService do
 
context 'when usage ping is enabled' do
before do
allow(ActiveRecord::Base.connection).to receive(:transaction_open?).and_return(false)
stub_application_setting(usage_ping_enabled: true)
end
 
Loading
Loading
Loading
Loading
@@ -23,6 +23,29 @@ filebeat:
output.elasticsearch:
enabled: true
hosts: ["http://elastic-stack-elasticsearch-client:9200"]
filebeat.prospectors:
- type: log
enabled: true
paths:
- /var/log/*.log
- /var/log/messages
- /var/log/syslog
- type: docker
containers.ids:
- "*"
json.keys_under_root: true
json.ignore_decoding_error: true
processors:
- add_kubernetes_metadata:
- drop_event:
when:
equals:
kubernetes.container.name: "filebeat"
- decode_json_fields:
fields: ["message"]
when:
equals:
kubernetes.container.name: "modsecurity-log"
 
fluentd:
enabled: false
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment