summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-02-13 13:19:23 +0100
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-02-13 15:11:21 +0100
commitb35e62491316ff92379a26b504144d3a2f2a11bf (patch)
tree7f6fee7d073cccc12bc5922a42a1634b72fe7cd5 /spec
parent6f9b4583035bd791d0786c6bfb90d43a5af88a8e (diff)
downloadgitlab-ce-b35e62491316ff92379a26b504144d3a2f2a11bf.tar.gz
Fix pipeline processing specs after adding ability checks
Diffstat (limited to 'spec')
-rw-r--r--spec/services/ci/process_pipeline_service_spec.rb14
1 files changed, 11 insertions, 3 deletions
diff --git a/spec/services/ci/process_pipeline_service_spec.rb b/spec/services/ci/process_pipeline_service_spec.rb
index ebb11166964..823808ccce1 100644
--- a/spec/services/ci/process_pipeline_service_spec.rb
+++ b/spec/services/ci/process_pipeline_service_spec.rb
@@ -1,8 +1,16 @@
require 'spec_helper'
-describe Ci::ProcessPipelineService, services: true do
- let(:pipeline) { create(:ci_empty_pipeline, ref: 'master') }
+describe Ci::ProcessPipelineService, :services do
let(:user) { create(:user) }
+ let(:project) { create(:empty_project) }
+
+ let(:pipeline) do
+ create(:ci_empty_pipeline, ref: 'master', project: project)
+ end
+
+ before do
+ project.team << [user, :developer]
+ end
describe '#execute' do
context 'start queuing next builds' do
@@ -285,7 +293,7 @@ describe Ci::ProcessPipelineService, services: true do
expect(builds.pluck(:name))
.to contain_exactly('build:1', 'build:2', 'test:1', 'test:2')
- Ci::Build.retry(pipeline.builds.find_by(name: 'test:2')).success
+ Ci::Build.retry(pipeline.builds.find_by(name: 'test:2'), user).success
expect(builds.pluck(:name)).to contain_exactly(
'build:1', 'build:2', 'test:1', 'test:2', 'test:2', 'deploy:1', 'deploy:2')