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:
authorLin Jen-Shin <godfat@godfat.org>2017-07-04 00:58:28 +0300
committerLin Jen-Shin <godfat@godfat.org>2017-07-04 16:56:41 +0300
commit28553dbc05989b698777ee085aa2a357ffe576d2 (patch)
tree8005538c73dd33ce949047d201f8d2b55ba2294e /spec/services/ci
parent005870d5ce1a00b3405d0ae3a639d0c4befcb7a2 (diff)
Update tests due to permission changes
Diffstat (limited to 'spec/services/ci')
-rw-r--r--spec/services/ci/process_pipeline_service_spec.rb2
-rw-r--r--spec/services/ci/retry_build_service_spec.rb4
-rw-r--r--spec/services/ci/retry_pipeline_service_spec.rb20
3 files changed, 9 insertions, 17 deletions
diff --git a/spec/services/ci/process_pipeline_service_spec.rb b/spec/services/ci/process_pipeline_service_spec.rb
index efcaccc254e..1e938a97f5a 100644
--- a/spec/services/ci/process_pipeline_service_spec.rb
+++ b/spec/services/ci/process_pipeline_service_spec.rb
@@ -9,7 +9,7 @@ describe Ci::ProcessPipelineService, '#execute', :services do
end
before do
- project.add_developer(user)
+ project.add_master(user)
end
context 'when simple pipeline is defined' do
diff --git a/spec/services/ci/retry_build_service_spec.rb b/spec/services/ci/retry_build_service_spec.rb
index ef9927c5969..52c6a4a0bc8 100644
--- a/spec/services/ci/retry_build_service_spec.rb
+++ b/spec/services/ci/retry_build_service_spec.rb
@@ -85,7 +85,7 @@ describe Ci::RetryBuildService, :services do
context 'when user has ability to execute build' do
before do
- project.add_developer(user)
+ project.add_master(user)
end
it_behaves_like 'build duplication'
@@ -131,7 +131,7 @@ describe Ci::RetryBuildService, :services do
context 'when user has ability to execute build' do
before do
- project.add_developer(user)
+ project.add_master(user)
end
it_behaves_like 'build duplication'
diff --git a/spec/services/ci/retry_pipeline_service_spec.rb b/spec/services/ci/retry_pipeline_service_spec.rb
index 3e860203063..7798db3f3b9 100644
--- a/spec/services/ci/retry_pipeline_service_spec.rb
+++ b/spec/services/ci/retry_pipeline_service_spec.rb
@@ -244,13 +244,9 @@ describe Ci::RetryPipelineService, '#execute', :services do
create_build('verify', :canceled, 1)
end
- it 'does not reprocess manual action' do
- service.execute(pipeline)
-
- expect(build('test')).to be_pending
- expect(build('deploy')).to be_failed
- expect(build('verify')).to be_created
- expect(pipeline.reload).to be_running
+ it 'raises an error' do
+ expect { service.execute(pipeline) }
+ .to raise_error Gitlab::Access::AccessDeniedError
end
end
@@ -261,13 +257,9 @@ describe Ci::RetryPipelineService, '#execute', :services do
create_build('verify', :canceled, 2)
end
- it 'does not reprocess manual action' do
- service.execute(pipeline)
-
- expect(build('test')).to be_pending
- expect(build('deploy')).to be_failed
- expect(build('verify')).to be_created
- expect(pipeline.reload).to be_running
+ it 'raises an error' do
+ expect { service.execute(pipeline) }
+ .to raise_error Gitlab::Access::AccessDeniedError
end
end
end