diff options
author | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-04-06 15:19:52 +0200 |
---|---|---|
committer | Grzegorz Bizon <grzesiek.bizon@gmail.com> | 2017-04-06 17:15:15 +0200 |
commit | 6c0fc62ef5c4fa4535174a9f187b9853f0fb90ac (patch) | |
tree | 0db34e09c24d3b98baa48e4db6ac27e0b4324871 /spec/services/ci | |
parent | e533d43a8c03a9b47a7016f3fea01a00ca797778 (diff) | |
download | gitlab-ce-6c0fc62ef5c4fa4535174a9f187b9853f0fb90ac.tar.gz |
Take branch access into account when stopping environment
Diffstat (limited to 'spec/services/ci')
-rw-r--r-- | spec/services/ci/stop_environments_service_spec.rb | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/spec/services/ci/stop_environments_service_spec.rb b/spec/services/ci/stop_environments_service_spec.rb index 32c72a9cf5e..98044ad232e 100644 --- a/spec/services/ci/stop_environments_service_spec.rb +++ b/spec/services/ci/stop_environments_service_spec.rb @@ -55,8 +55,22 @@ describe Ci::StopEnvironmentsService, services: true do end context 'when user does not have permission to stop environment' do + context 'when user has no access to manage deployments' do + before do + project.team << [user, :guest] + end + + it 'does not stop environment' do + expect_environment_not_stopped_on('master') + end + end + end + + context 'when branch for stop action is protected' do before do - project.team << [user, :guest] + project.add_developer(user) + create(:protected_branch, :no_one_can_push, + name: 'master', project: project) end it 'does not stop environment' do |