| ... | @@ -16,7 +16,7 @@ describe API::Internal::Base do |
... | @@ -16,7 +16,7 @@ describe API::Internal::Base do |
|
|
|
|
|
|
|
get api("/internal/check"), params: { secret_token: secret_token }
|
|
get api("/internal/check"), params: { secret_token: secret_token }
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(200)
|
|
expect(response).to have_gitlab_http_status(:ok)
|
|
|
expect(json_response['api_version']).to eq(API::API.version)
|
|
expect(json_response['api_version']).to eq(API::API.version)
|
|
|
expect(json_response['redis']).to be(true)
|
|
expect(json_response['redis']).to be(true)
|
|
|
end
|
|
end
|
| ... | @@ -34,13 +34,13 @@ describe API::Internal::Base do |
... | @@ -34,13 +34,13 @@ describe API::Internal::Base do |
|
|
get api("/internal/check"),
|
|
get api("/internal/check"),
|
|
|
headers: { API::Helpers::GITLAB_SHARED_SECRET_HEADER => Base64.encode64(secret_token) }
|
|
headers: { API::Helpers::GITLAB_SHARED_SECRET_HEADER => Base64.encode64(secret_token) }
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(200)
|
|
expect(response).to have_gitlab_http_status(:ok)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
it 'returns 401 when no credentials provided' do
|
|
it 'returns 401 when no credentials provided' do
|
|
|
get(api("/internal/check"))
|
|
get(api("/internal/check"))
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(401)
|
|
expect(response).to have_gitlab_http_status(:unauthorized)
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
| ... | @@ -126,7 +126,7 @@ describe API::Internal::Base do |
... | @@ -126,7 +126,7 @@ describe API::Internal::Base do |
|
|
it 'returns the correct information about the key' do
|
|
it 'returns the correct information about the key' do
|
|
|
lfs_auth_key(key.id, project)
|
|
lfs_auth_key(key.id, project)
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(200)
|
|
expect(response).to have_gitlab_http_status(:ok)
|
|
|
expect(json_response['username']).to eq(user.username)
|
|
expect(json_response['username']).to eq(user.username)
|
|
|
expect(json_response['repository_http_path']).to eq(project.http_url_to_repo)
|
|
expect(json_response['repository_http_path']).to eq(project.http_url_to_repo)
|
|
|
expect(json_response['expires_in']).to eq(Gitlab::LfsToken::DEFAULT_EXPIRE_TIME)
|
|
expect(json_response['expires_in']).to eq(Gitlab::LfsToken::DEFAULT_EXPIRE_TIME)
|
| ... | @@ -136,7 +136,7 @@ describe API::Internal::Base do |
... | @@ -136,7 +136,7 @@ describe API::Internal::Base do |
|
|
it 'returns the correct information about the user' do
|
|
it 'returns the correct information about the user' do
|
|
|
lfs_auth_user(user.id, project)
|
|
lfs_auth_user(user.id, project)
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(200)
|
|
expect(response).to have_gitlab_http_status(:ok)
|
|
|
expect(json_response['username']).to eq(user.username)
|
|
expect(json_response['username']).to eq(user.username)
|
|
|
expect(json_response['repository_http_path']).to eq(project.http_url_to_repo)
|
|
expect(json_response['repository_http_path']).to eq(project.http_url_to_repo)
|
|
|
expect(Gitlab::LfsToken.new(user).token_valid?(json_response['lfs_token'])).to be_truthy
|
|
expect(Gitlab::LfsToken.new(user).token_valid?(json_response['lfs_token'])).to be_truthy
|
| ... | @@ -145,19 +145,19 @@ describe API::Internal::Base do |
... | @@ -145,19 +145,19 @@ describe API::Internal::Base do |
|
|
it 'returns a 404 when no key or user is provided' do
|
|
it 'returns a 404 when no key or user is provided' do
|
|
|
lfs_auth_project(project)
|
|
lfs_auth_project(project)
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(404)
|
|
expect(response).to have_gitlab_http_status(:not_found)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
it 'returns a 404 when the wrong key is provided' do
|
|
it 'returns a 404 when the wrong key is provided' do
|
|
|
lfs_auth_key(key.id + 12345, project)
|
|
lfs_auth_key(key.id + 12345, project)
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(404)
|
|
expect(response).to have_gitlab_http_status(:not_found)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
it 'returns a 404 when the wrong user is provided' do
|
|
it 'returns a 404 when the wrong user is provided' do
|
|
|
lfs_auth_user(user.id + 12345, project)
|
|
lfs_auth_user(user.id + 12345, project)
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(404)
|
|
expect(response).to have_gitlab_http_status(:not_found)
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
|
|
|
|
|
| ... | @@ -167,7 +167,7 @@ describe API::Internal::Base do |
... | @@ -167,7 +167,7 @@ describe API::Internal::Base do |
|
|
it 'returns the correct information about the key' do
|
|
it 'returns the correct information about the key' do
|
|
|
lfs_auth_key(key.id, project)
|
|
lfs_auth_key(key.id, project)
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(200)
|
|
expect(response).to have_gitlab_http_status(:ok)
|
|
|
expect(json_response['username']).to eq("lfs+deploy-key-#{key.id}")
|
|
expect(json_response['username']).to eq("lfs+deploy-key-#{key.id}")
|
|
|
expect(json_response['repository_http_path']).to eq(project.http_url_to_repo)
|
|
expect(json_response['repository_http_path']).to eq(project.http_url_to_repo)
|
|
|
expect(Gitlab::LfsToken.new(key).token_valid?(json_response['lfs_token'])).to be_truthy
|
|
expect(Gitlab::LfsToken.new(key).token_valid?(json_response['lfs_token'])).to be_truthy
|
| ... | @@ -179,7 +179,7 @@ describe API::Internal::Base do |
... | @@ -179,7 +179,7 @@ describe API::Internal::Base do |
|
|
it "finds a user by key id" do
|
|
it "finds a user by key id" do
|
|
|
get(api("/internal/discover"), params: { key_id: key.id, secret_token: secret_token })
|
|
get(api("/internal/discover"), params: { key_id: key.id, secret_token: secret_token })
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(200)
|
|
expect(response).to have_gitlab_http_status(:ok)
|
|
|
|
|
|
|
|
expect(json_response['name']).to eq(user.name)
|
|
expect(json_response['name']).to eq(user.name)
|
|
|
end
|
|
end
|
| ... | @@ -187,7 +187,7 @@ describe API::Internal::Base do |
... | @@ -187,7 +187,7 @@ describe API::Internal::Base do |
|
|
it "finds a user by username" do
|
|
it "finds a user by username" do
|
|
|
get(api("/internal/discover"), params: { username: user.username, secret_token: secret_token })
|
|
get(api("/internal/discover"), params: { username: user.username, secret_token: secret_token })
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(200)
|
|
expect(response).to have_gitlab_http_status(:ok)
|
|
|
|
|
|
|
|
expect(json_response['name']).to eq(user.name)
|
|
expect(json_response['name']).to eq(user.name)
|
|
|
end
|
|
end
|
| ... | @@ -195,7 +195,7 @@ describe API::Internal::Base do |
... | @@ -195,7 +195,7 @@ describe API::Internal::Base do |
|
|
it 'responds successfully when a user is not found' do
|
|
it 'responds successfully when a user is not found' do
|
|
|
get(api('/internal/discover'), params: { username: 'noone', secret_token: secret_token })
|
|
get(api('/internal/discover'), params: { username: 'noone', secret_token: secret_token })
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(200)
|
|
expect(response).to have_gitlab_http_status(:ok)
|
|
|
|
|
|
|
|
expect(response.body).to eq('null')
|
|
expect(response.body).to eq('null')
|
|
|
end
|
|
end
|
| ... | @@ -203,7 +203,7 @@ describe API::Internal::Base do |
... | @@ -203,7 +203,7 @@ describe API::Internal::Base do |
|
|
it 'response successfully when passing invalid params' do
|
|
it 'response successfully when passing invalid params' do
|
|
|
get(api('/internal/discover'), params: { nothing: 'to find a user', secret_token: secret_token })
|
|
get(api('/internal/discover'), params: { nothing: 'to find a user', secret_token: secret_token })
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(200)
|
|
expect(response).to have_gitlab_http_status(:ok)
|
|
|
|
|
|
|
|
expect(response.body).to eq('null')
|
|
expect(response.body).to eq('null')
|
|
|
end
|
|
end
|
| ... | @@ -284,7 +284,7 @@ describe API::Internal::Base do |
... | @@ -284,7 +284,7 @@ describe API::Internal::Base do |
|
|
GIT_ALTERNATE_OBJECT_DIRECTORIES_RELATIVE: alt_obj_dirs_relative
|
|
GIT_ALTERNATE_OBJECT_DIRECTORIES_RELATIVE: alt_obj_dirs_relative
|
|
|
}.to_json)
|
|
}.to_json)
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(200)
|
|
expect(response).to have_gitlab_http_status(:ok)
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
|
|
|
|
|
| ... | @@ -292,7 +292,7 @@ describe API::Internal::Base do |
... | @@ -292,7 +292,7 @@ describe API::Internal::Base do |
|
|
it 'responds with success' do
|
|
it 'responds with success' do
|
|
|
push(key, project.wiki)
|
|
push(key, project.wiki)
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(200)
|
|
expect(response).to have_gitlab_http_status(:ok)
|
|
|
expect(json_response["status"]).to be_truthy
|
|
expect(json_response["status"]).to be_truthy
|
|
|
expect(json_response["gl_project_path"]).to eq(project.wiki.full_path)
|
|
expect(json_response["gl_project_path"]).to eq(project.wiki.full_path)
|
|
|
expect(json_response["gl_repository"]).to eq("wiki-#{project.id}")
|
|
expect(json_response["gl_repository"]).to eq("wiki-#{project.id}")
|
| ... | @@ -304,7 +304,7 @@ describe API::Internal::Base do |
... | @@ -304,7 +304,7 @@ describe API::Internal::Base do |
|
|
it 'responds with success' do
|
|
it 'responds with success' do
|
|
|
pull(key, project.wiki)
|
|
pull(key, project.wiki)
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(200)
|
|
expect(response).to have_gitlab_http_status(:ok)
|
|
|
expect(json_response["status"]).to be_truthy
|
|
expect(json_response["status"]).to be_truthy
|
|
|
expect(json_response["gl_project_path"]).to eq(project.wiki.full_path)
|
|
expect(json_response["gl_project_path"]).to eq(project.wiki.full_path)
|
|
|
expect(json_response["gl_repository"]).to eq("wiki-#{project.id}")
|
|
expect(json_response["gl_repository"]).to eq("wiki-#{project.id}")
|
| ... | @@ -320,7 +320,7 @@ describe API::Internal::Base do |
... | @@ -320,7 +320,7 @@ describe API::Internal::Base do |
|
|
it "has the correct payload" do
|
|
it "has the correct payload" do
|
|
|
pull(key, project)
|
|
pull(key, project)
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(200)
|
|
expect(response).to have_gitlab_http_status(:ok)
|
|
|
expect(json_response["status"]).to be_truthy
|
|
expect(json_response["status"]).to be_truthy
|
|
|
expect(json_response["gl_repository"]).to eq("project-#{project.id}")
|
|
expect(json_response["gl_repository"]).to eq("project-#{project.id}")
|
|
|
expect(json_response["gl_project_path"]).to eq(project.full_path)
|
|
expect(json_response["gl_project_path"]).to eq(project.full_path)
|
| ... | @@ -340,7 +340,7 @@ describe API::Internal::Base do |
... | @@ -340,7 +340,7 @@ describe API::Internal::Base do |
|
|
it do
|
|
it do
|
|
|
push(key, project)
|
|
push(key, project)
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(200)
|
|
expect(response).to have_gitlab_http_status(:ok)
|
|
|
expect(json_response["status"]).to be_truthy
|
|
expect(json_response["status"]).to be_truthy
|
|
|
expect(json_response["gl_repository"]).to eq("project-#{project.id}")
|
|
expect(json_response["gl_repository"]).to eq("project-#{project.id}")
|
|
|
expect(json_response["gl_project_path"]).to eq(project.full_path)
|
|
expect(json_response["gl_project_path"]).to eq(project.full_path)
|
| ... | @@ -409,7 +409,7 @@ describe API::Internal::Base do |
... | @@ -409,7 +409,7 @@ describe API::Internal::Base do |
|
|
it do
|
|
it do
|
|
|
pull(key, project)
|
|
pull(key, project)
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(401)
|
|
expect(response).to have_gitlab_http_status(:unauthorized)
|
|
|
expect(json_response["status"]).to be_falsey
|
|
expect(json_response["status"]).to be_falsey
|
|
|
expect(user.reload.last_activity_on).to be_nil
|
|
expect(user.reload.last_activity_on).to be_nil
|
|
|
end
|
|
end
|
| ... | @@ -419,7 +419,7 @@ describe API::Internal::Base do |
... | @@ -419,7 +419,7 @@ describe API::Internal::Base do |
|
|
it do
|
|
it do
|
|
|
push(key, project)
|
|
push(key, project)
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(401)
|
|
expect(response).to have_gitlab_http_status(:unauthorized)
|
|
|
expect(json_response["status"]).to be_falsey
|
|
expect(json_response["status"]).to be_falsey
|
|
|
expect(user.reload.last_activity_on).to be_nil
|
|
expect(user.reload.last_activity_on).to be_nil
|
|
|
end
|
|
end
|
| ... | @@ -464,7 +464,7 @@ describe API::Internal::Base do |
... | @@ -464,7 +464,7 @@ describe API::Internal::Base do |
|
|
it do
|
|
it do
|
|
|
push(key, project)
|
|
push(key, project)
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(300)
|
|
expect(response).to have_gitlab_http_status(:multiple_choices)
|
|
|
expect(json_response['status']).to be_truthy
|
|
expect(json_response['status']).to be_truthy
|
|
|
expect(json_response['payload']).to eql(payload)
|
|
expect(json_response['payload']).to eql(payload)
|
|
|
expect(json_response['gl_console_messages']).to eql(console_messages)
|
|
expect(json_response['gl_console_messages']).to eql(console_messages)
|
| ... | @@ -483,7 +483,7 @@ describe API::Internal::Base do |
... | @@ -483,7 +483,7 @@ describe API::Internal::Base do |
|
|
it "has the correct payload" do
|
|
it "has the correct payload" do
|
|
|
pull(key, project)
|
|
pull(key, project)
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(200)
|
|
expect(response).to have_gitlab_http_status(:ok)
|
|
|
expect(json_response['gl_console_messages']).to eq([])
|
|
expect(json_response['gl_console_messages']).to eq([])
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
| ... | @@ -500,7 +500,7 @@ describe API::Internal::Base do |
... | @@ -500,7 +500,7 @@ describe API::Internal::Base do |
|
|
|
|
|
|
|
pull(key, project)
|
|
pull(key, project)
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(200)
|
|
expect(response).to have_gitlab_http_status(:ok)
|
|
|
expect(json_response['gl_console_messages']).to eq(console_messages)
|
|
expect(json_response['gl_console_messages']).to eq(console_messages)
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
| ... | @@ -518,7 +518,7 @@ describe API::Internal::Base do |
... | @@ -518,7 +518,7 @@ describe API::Internal::Base do |
|
|
it do
|
|
it do
|
|
|
pull(key, personal_project)
|
|
pull(key, personal_project)
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(401)
|
|
expect(response).to have_gitlab_http_status(:unauthorized)
|
|
|
expect(json_response["status"]).to be_falsey
|
|
expect(json_response["status"]).to be_falsey
|
|
|
expect(user.reload.last_activity_on).to be_nil
|
|
expect(user.reload.last_activity_on).to be_nil
|
|
|
end
|
|
end
|
| ... | @@ -528,7 +528,7 @@ describe API::Internal::Base do |
... | @@ -528,7 +528,7 @@ describe API::Internal::Base do |
|
|
it do
|
|
it do
|
|
|
push(key, personal_project)
|
|
push(key, personal_project)
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(401)
|
|
expect(response).to have_gitlab_http_status(:unauthorized)
|
|
|
expect(json_response["status"]).to be_falsey
|
|
expect(json_response["status"]).to be_falsey
|
|
|
expect(user.reload.last_activity_on).to be_nil
|
|
expect(user.reload.last_activity_on).to be_nil
|
|
|
end
|
|
end
|
| ... | @@ -545,7 +545,7 @@ describe API::Internal::Base do |
... | @@ -545,7 +545,7 @@ describe API::Internal::Base do |
|
|
end
|
|
end
|
|
|
push(key, personal_project)
|
|
push(key, personal_project)
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(503)
|
|
expect(response).to have_gitlab_http_status(:service_unavailable)
|
|
|
expect(json_response['status']).to be_falsey
|
|
expect(json_response['status']).to be_falsey
|
|
|
expect(json_response['message']).to eq("Foo")
|
|
expect(json_response['message']).to eq("Foo")
|
|
|
expect(user.reload.last_activity_on).to be_nil
|
|
expect(user.reload.last_activity_on).to be_nil
|
| ... | @@ -563,7 +563,7 @@ describe API::Internal::Base do |
... | @@ -563,7 +563,7 @@ describe API::Internal::Base do |
|
|
it do
|
|
it do
|
|
|
pull(key, project)
|
|
pull(key, project)
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(200)
|
|
expect(response).to have_gitlab_http_status(:ok)
|
|
|
expect(json_response["status"]).to be_truthy
|
|
expect(json_response["status"]).to be_truthy
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
| ... | @@ -572,7 +572,7 @@ describe API::Internal::Base do |
... | @@ -572,7 +572,7 @@ describe API::Internal::Base do |
|
|
it do
|
|
it do
|
|
|
push(key, project)
|
|
push(key, project)
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(401)
|
|
expect(response).to have_gitlab_http_status(:unauthorized)
|
|
|
expect(json_response["status"]).to be_falsey
|
|
expect(json_response["status"]).to be_falsey
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
| ... | @@ -589,7 +589,7 @@ describe API::Internal::Base do |
... | @@ -589,7 +589,7 @@ describe API::Internal::Base do |
|
|
it do
|
|
it do
|
|
|
archive(key, project)
|
|
archive(key, project)
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(200)
|
|
expect(response).to have_gitlab_http_status(:ok)
|
|
|
expect(json_response["status"]).to be_truthy
|
|
expect(json_response["status"]).to be_truthy
|
|
|
expect(json_response["gitaly"]).not_to be_nil
|
|
expect(json_response["gitaly"]).not_to be_nil
|
|
|
expect(json_response["gitaly"]["repository"]).not_to be_nil
|
|
expect(json_response["gitaly"]["repository"]).not_to be_nil
|
| ... | @@ -604,7 +604,7 @@ describe API::Internal::Base do |
... | @@ -604,7 +604,7 @@ describe API::Internal::Base do |
|
|
it do
|
|
it do
|
|
|
archive(key, project)
|
|
archive(key, project)
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(404)
|
|
expect(response).to have_gitlab_http_status(:not_found)
|
|
|
expect(json_response["status"]).to be_falsey
|
|
expect(json_response["status"]).to be_falsey
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
| ... | @@ -616,7 +616,7 @@ describe API::Internal::Base do |
... | @@ -616,7 +616,7 @@ describe API::Internal::Base do |
|
|
|
|
|
|
|
pull(key, project)
|
|
pull(key, project)
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(404)
|
|
expect(response).to have_gitlab_http_status(:not_found)
|
|
|
expect(json_response["status"]).to be_falsey
|
|
expect(json_response["status"]).to be_falsey
|
|
|
end
|
|
end
|
|
|
|
|
|
| ... | @@ -632,7 +632,7 @@ describe API::Internal::Base do |
... | @@ -632,7 +632,7 @@ describe API::Internal::Base do |
|
|
}
|
|
}
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(404)
|
|
expect(response).to have_gitlab_http_status(:not_found)
|
|
|
expect(json_response["status"]).to be_falsey
|
|
expect(json_response["status"]).to be_falsey
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
| ... | @@ -641,7 +641,7 @@ describe API::Internal::Base do |
... | @@ -641,7 +641,7 @@ describe API::Internal::Base do |
|
|
it do
|
|
it do
|
|
|
pull(OpenStruct.new(id: 0), project)
|
|
pull(OpenStruct.new(id: 0), project)
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(404)
|
|
expect(response).to have_gitlab_http_status(:not_found)
|
|
|
expect(json_response["status"]).to be_falsey
|
|
expect(json_response["status"]).to be_falsey
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
| ... | @@ -714,14 +714,14 @@ describe API::Internal::Base do |
... | @@ -714,14 +714,14 @@ describe API::Internal::Base do |
|
|
it 'rejects the push' do
|
|
it 'rejects the push' do
|
|
|
push(key, project)
|
|
push(key, project)
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(404)
|
|
expect(response).to have_gitlab_http_status(:not_found)
|
|
|
expect(json_response['status']).to be_falsy
|
|
expect(json_response['status']).to be_falsy
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
it 'rejects the SSH pull' do
|
|
it 'rejects the SSH pull' do
|
|
|
pull(key, project)
|
|
pull(key, project)
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(404)
|
|
expect(response).to have_gitlab_http_status(:not_found)
|
|
|
expect(json_response['status']).to be_falsy
|
|
expect(json_response['status']).to be_falsy
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
| ... | @@ -750,7 +750,7 @@ describe API::Internal::Base do |
... | @@ -750,7 +750,7 @@ describe API::Internal::Base do |
|
|
#
|
|
#
|
|
|
# post api("/internal/notify_post_receive"), valid_params
|
|
# post api("/internal/notify_post_receive"), valid_params
|
|
|
#
|
|
#
|
|
|
# expect(response).to have_gitlab_http_status(200)
|
|
# expect(response).to have_gitlab_http_status(:ok)
|
|
|
# end
|
|
# end
|
|
|
#
|
|
#
|
|
|
# it "calls the Gitaly client with the wiki's repository if it's a wiki" do
|
|
# it "calls the Gitaly client with the wiki's repository if it's a wiki" do
|
| ... | @@ -762,7 +762,7 @@ describe API::Internal::Base do |
... | @@ -762,7 +762,7 @@ describe API::Internal::Base do |
|
|
#
|
|
#
|
|
|
# post api("/internal/notify_post_receive"), valid_wiki_params
|
|
# post api("/internal/notify_post_receive"), valid_wiki_params
|
|
|
#
|
|
#
|
|
|
# expect(response).to have_gitlab_http_status(200)
|
|
# expect(response).to have_gitlab_http_status(:ok)
|
|
|
# end
|
|
# end
|
|
|
#
|
|
#
|
|
|
# it "returns 500 if the gitaly call fails" do
|
|
# it "returns 500 if the gitaly call fails" do
|
| ... | @@ -771,7 +771,7 @@ describe API::Internal::Base do |
... | @@ -771,7 +771,7 @@ describe API::Internal::Base do |
|
|
#
|
|
#
|
|
|
# post api("/internal/notify_post_receive"), valid_params
|
|
# post api("/internal/notify_post_receive"), valid_params
|
|
|
#
|
|
#
|
|
|
# expect(response).to have_gitlab_http_status(500)
|
|
# expect(response).to have_gitlab_http_status(:internal_server_error)
|
|
|
# end
|
|
# end
|
|
|
#
|
|
#
|
|
|
# context 'with a gl_repository parameter' do
|
|
# context 'with a gl_repository parameter' do
|
| ... | @@ -792,7 +792,7 @@ describe API::Internal::Base do |
... | @@ -792,7 +792,7 @@ describe API::Internal::Base do |
|
|
#
|
|
#
|
|
|
# post api("/internal/notify_post_receive"), valid_params
|
|
# post api("/internal/notify_post_receive"), valid_params
|
|
|
#
|
|
#
|
|
|
# expect(response).to have_gitlab_http_status(200)
|
|
# expect(response).to have_gitlab_http_status(:ok)
|
|
|
# end
|
|
# end
|
|
|
#
|
|
#
|
|
|
# it "calls the Gitaly client with the wiki's repository if it's a wiki" do
|
|
# it "calls the Gitaly client with the wiki's repository if it's a wiki" do
|
| ... | @@ -804,7 +804,7 @@ describe API::Internal::Base do |
... | @@ -804,7 +804,7 @@ describe API::Internal::Base do |
|
|
#
|
|
#
|
|
|
# post api("/internal/notify_post_receive"), valid_wiki_params
|
|
# post api("/internal/notify_post_receive"), valid_wiki_params
|
|
|
#
|
|
#
|
|
|
# expect(response).to have_gitlab_http_status(200)
|
|
# expect(response).to have_gitlab_http_status(:ok)
|
|
|
# end
|
|
# end
|
|
|
# end
|
|
# end
|
|
|
# end
|
|
# end
|
| ... | @@ -961,7 +961,7 @@ describe API::Internal::Base do |
... | @@ -961,7 +961,7 @@ describe API::Internal::Base do |
|
|
it 'outputs a broadcast message' do
|
|
it 'outputs a broadcast message' do
|
|
|
post api('/internal/post_receive'), params: valid_params
|
|
post api('/internal/post_receive'), params: valid_params
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(200)
|
|
expect(response).to have_gitlab_http_status(:ok)
|
|
|
expect(json_response['messages']).to include(build_alert_message(broadcast_message.message))
|
|
expect(json_response['messages']).to include(build_alert_message(broadcast_message.message))
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
| ... | @@ -970,7 +970,7 @@ describe API::Internal::Base do |
... | @@ -970,7 +970,7 @@ describe API::Internal::Base do |
|
|
it 'does not output a broadcast message' do
|
|
it 'does not output a broadcast message' do
|
|
|
post api('/internal/post_receive'), params: valid_params
|
|
post api('/internal/post_receive'), params: valid_params
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(200)
|
|
expect(response).to have_gitlab_http_status(:ok)
|
|
|
expect(has_alert_messages?(json_response['messages'])).to be_falsey
|
|
expect(has_alert_messages?(json_response['messages'])).to be_falsey
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
| ... | @@ -981,7 +981,7 @@ describe API::Internal::Base do |
... | @@ -981,7 +981,7 @@ describe API::Internal::Base do |
|
|
|
|
|
|
|
post api('/internal/post_receive'), params: valid_params
|
|
post api('/internal/post_receive'), params: valid_params
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(200)
|
|
expect(response).to have_gitlab_http_status(:ok)
|
|
|
expect(has_alert_messages?(json_response['messages'])).to be_falsey
|
|
expect(has_alert_messages?(json_response['messages'])).to be_falsey
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
| ... | @@ -993,7 +993,7 @@ describe API::Internal::Base do |
... | @@ -993,7 +993,7 @@ describe API::Internal::Base do |
|
|
|
|
|
|
|
post api('/internal/post_receive'), params: valid_params
|
|
post api('/internal/post_receive'), params: valid_params
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(200)
|
|
expect(response).to have_gitlab_http_status(:ok)
|
|
|
expect(json_response['messages']).to include(build_basic_message(project_moved.message))
|
|
expect(json_response['messages']).to include(build_basic_message(project_moved.message))
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
| ... | @@ -1005,7 +1005,7 @@ describe API::Internal::Base do |
... | @@ -1005,7 +1005,7 @@ describe API::Internal::Base do |
|
|
|
|
|
|
|
post api('/internal/post_receive'), params: valid_params
|
|
post api('/internal/post_receive'), params: valid_params
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(200)
|
|
expect(response).to have_gitlab_http_status(:ok)
|
|
|
expect(json_response['messages']).to include(build_basic_message(project_created.message))
|
|
expect(json_response['messages']).to include(build_basic_message(project_created.message))
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
| ... | @@ -1018,7 +1018,7 @@ describe API::Internal::Base do |
... | @@ -1018,7 +1018,7 @@ describe API::Internal::Base do |
|
|
|
|
|
|
|
post api('/internal/post_receive'), params: valid_params
|
|
post api('/internal/post_receive'), params: valid_params
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(200)
|
|
expect(response).to have_gitlab_http_status(:ok)
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
|
|
|
|
|
| ... | @@ -1032,7 +1032,7 @@ describe API::Internal::Base do |
... | @@ -1032,7 +1032,7 @@ describe API::Internal::Base do |
|
|
|
|
|
|
|
post api('/internal/post_receive'), params: valid_params
|
|
post api('/internal/post_receive'), params: valid_params
|
|
|
|
|
|
|
|
expect(response).to have_gitlab_http_status(200)
|
|
expect(response).to have_gitlab_http_status(:ok)
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
|
|
end
|
|
end
|
| ... | |
... | |
| ... | | ... | |