Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Botelho <tiagonbotelho@hotmail.com>2018-01-25 15:26:52 +0300
committerTiago Botelho <tiagonbotelho@hotmail.com>2018-02-06 16:35:35 +0300
commite42a548f1dac02577d0c1731fef508dab68c45a5 (patch)
tree9781b82ec0da58683ebeb0fd0ba2062a9ce10e43 /spec/requests/api/internal_spec.rb
parentbc78ae6985ee37f9ac2ffc2dbf6f445078d16038 (diff)
Move new project on push logic to a service
Diffstat (limited to 'spec/requests/api/internal_spec.rb')
-rw-r--r--spec/requests/api/internal_spec.rb19
1 files changed, 15 insertions, 4 deletions
diff --git a/spec/requests/api/internal_spec.rb b/spec/requests/api/internal_spec.rb
index 5f6790312e4..1e8197653ce 100644
--- a/spec/requests/api/internal_spec.rb
+++ b/spec/requests/api/internal_spec.rb
@@ -366,6 +366,17 @@ describe API::Internal do
end
end
+ context 'project as /namespace/project' do
+ it do
+ push(key, project_with_repo_path('/' + project.full_path))
+
+ expect(response).to have_gitlab_http_status(200)
+ expect(json_response["status"]).to be_truthy
+ expect(json_response["repository_path"]).to eq(project.repository.path_to_repo)
+ expect(json_response["gl_repository"]).to eq("project-#{project.id}")
+ end
+ end
+
context 'project as namespace/project' do
it do
push(key, project_with_repo_path(project.full_path))
@@ -823,14 +834,14 @@ describe API::Internal do
context 'with new project data' do
it 'returns new project message on the response' do
- new_project = Gitlab::Checks::NewProject.new(user, project, 'http')
- new_project.add_new_project_message
+ project_created = Gitlab::Checks::ProjectCreated.new(user, project, 'http')
+ project_created.add_project_created_message
post api("/internal/post_receive"), valid_params
expect(response).to have_gitlab_http_status(200)
- expect(json_response["new_project_message"]).to be_present
- expect(json_response["new_project_message"]).to eq(new_project.new_project_message)
+ expect(json_response["project_created_message"]).to be_present
+ expect(json_response["project_created_message"]).to eq(project_created.project_created_message)
end
end