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:
authorValery Sizov <vsv2711@gmail.com>2015-09-16 12:43:16 +0300
committerKamil Trzcinski <ayufan@ayufan.eu>2015-09-18 19:02:11 +0300
commita0c1a12dee276f5d587514d24432e7647e07aeec (patch)
tree8c5797f2fff43c72361343dbcd70d1cd13067a88 /spec/requests
parentbdfe6b9603a7a6947644929c4ea966018f98c840 (diff)
remove API calls from CE to CI
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/api/projects_spec.rb2
-rw-r--r--spec/requests/api/services_spec.rb4
-rw-r--r--spec/requests/ci/api/forks_spec.rb59
3 files changed, 3 insertions, 62 deletions
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb
index 5bd8206b890..3007a15b0b1 100644
--- a/spec/requests/api/projects_spec.rb
+++ b/spec/requests/api/projects_spec.rb
@@ -89,7 +89,7 @@ describe API::API, api: true do
it 'returns projects in the correct order when ci_enabled_first parameter is passed' do
[project, project2, project3].each{ |project| project.build_missing_services }
- project2.gitlab_ci_service.update(active: true, token: "token", project_url: "http://ci.example.com/projects/1")
+ project2.gitlab_ci_service.update(active: true, token: "token")
get api('/projects', user), { ci_enabled_first: 'true' }
expect(response.status).to eq(200)
expect(json_response).to be_an Array
diff --git a/spec/requests/api/services_spec.rb b/spec/requests/api/services_spec.rb
index fb3b235446f..9aa60826f21 100644
--- a/spec/requests/api/services_spec.rb
+++ b/spec/requests/api/services_spec.rb
@@ -17,9 +17,9 @@ describe API::API, api: true do
it "should return if required fields missing" do
attrs = service_attrs
-
+
required_attributes = service_attrs_list.select do |attr|
- service_klass.validators_on(attr).any? do |v|
+ service_klass.validators_on(attr).any? do |v|
v.class == ActiveRecord::Validations::PresenceValidator
end
end
diff --git a/spec/requests/ci/api/forks_spec.rb b/spec/requests/ci/api/forks_spec.rb
deleted file mode 100644
index 37fa1e82f25..00000000000
--- a/spec/requests/ci/api/forks_spec.rb
+++ /dev/null
@@ -1,59 +0,0 @@
-require 'spec_helper'
-
-describe Ci::API::API do
- include ApiHelpers
-
- let(:project) { FactoryGirl.create(:ci_project) }
- let(:private_token) { create(:user).private_token }
-
- let(:options) do
- {
- private_token: private_token,
- url: GitlabCi.config.gitlab_ci.url
- }
- end
-
- before do
- stub_gitlab_calls
- end
-
-
- describe "POST /forks" do
- let(:project_info) do
- {
- project_id: project.gitlab_id,
- project_token: project.token,
- data: {
- id: create(:empty_project).id,
- name_with_namespace: "Gitlab.org / Underscore",
- path_with_namespace: "gitlab-org/underscore",
- default_branch: "master",
- ssh_url_to_repo: "git@example.com:gitlab-org/underscore"
- }
- }
- end
-
- context "with valid info" do
- before do
- options.merge!(project_info)
- end
-
- it "should create a project with valid data" do
- post ci_api("/forks"), options
- expect(response.status).to eq(201)
- expect(json_response['name']).to eq("Gitlab.org / Underscore")
- end
- end
-
- context "with invalid project info" do
- before do
- options.merge!({})
- end
-
- it "should error with invalid data" do
- post ci_api("/forks"), options
- expect(response.status).to eq(400)
- end
- end
- end
-end