summaryrefslogtreecommitdiff
path: root/spec/services
diff options
context:
space:
mode:
Diffstat (limited to 'spec/services')
-rw-r--r--spec/services/ci/create_project_service_spec.rb37
-rw-r--r--spec/services/projects/fork_service_spec.rb12
2 files changed, 4 insertions, 45 deletions
diff --git a/spec/services/ci/create_project_service_spec.rb b/spec/services/ci/create_project_service_spec.rb
deleted file mode 100644
index 2de7b0deca7..00000000000
--- a/spec/services/ci/create_project_service_spec.rb
+++ /dev/null
@@ -1,37 +0,0 @@
-require 'spec_helper'
-
-describe Ci::CreateProjectService do
- let(:service) { Ci::CreateProjectService.new }
- let(:current_user) { double.as_null_object }
- let(:project) { FactoryGirl.create :project }
-
- describe :execute do
- context 'valid params' do
- subject { service.execute(current_user, project) }
-
- it { is_expected.to be_kind_of(Ci::Project) }
- it { is_expected.to be_persisted }
- end
-
- context 'without project dump' do
- it 'should raise exception' do
- expect { service.execute(current_user, '', '') }.
- to raise_error(NoMethodError)
- end
- end
-
- context "forking" do
- let(:ci_origin_project) do
- FactoryGirl.create(:ci_project, shared_runners_enabled: true, public: true, allow_git_fetch: true)
- end
-
- subject { service.execute(current_user, project, ci_origin_project) }
-
- it "uses project as a template for settings and jobs" do
- expect(subject.shared_runners_enabled).to be_truthy
- expect(subject.public).to be_truthy
- expect(subject.allow_git_fetch).to be_truthy
- end
- end
- end
-end
diff --git a/spec/services/projects/fork_service_spec.rb b/spec/services/projects/fork_service_spec.rb
index 18ab333c1d1..65a8c81204d 100644
--- a/spec/services/projects/fork_service_spec.rb
+++ b/spec/services/projects/fork_service_spec.rb
@@ -43,14 +43,10 @@ describe Projects::ForkService do
end
context 'GitLab CI is enabled' do
- it "calls fork registrator for CI" do
- create(:ci_project, gl_project: @from_project)
- @from_project.build_missing_services
- @from_project.gitlab_ci_service.update_attributes(active: true)
-
- expect_any_instance_of(Ci::CreateProjectService).to receive(:execute)
-
- fork_project(@from_project, @to_user)
+ it "fork and enable CI for fork" do
+ @from_project.enable_ci
+ @to_project = fork_project(@from_project, @to_user)
+ expect(@to_project.gitlab_ci?).to be_truthy
end
end
end