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:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-11-14 16:10:54 +0300
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2016-11-14 16:10:54 +0300
commitceb06983ec186bcc1c6fce28613bdb92297e5bf1 (patch)
tree5f916ed102a5c91fae7a0bf5620f633c087acc68 /spec/services/ci/stop_environments_service_spec.rb
parent990765edf354a7bbb39d3897780fb85bf8d6fa48 (diff)
Make it possible to fabricate environment on branch
Diffstat (limited to 'spec/services/ci/stop_environments_service_spec.rb')
-rw-r--r--spec/services/ci/stop_environments_service_spec.rb17
1 files changed, 13 insertions, 4 deletions
diff --git a/spec/services/ci/stop_environments_service_spec.rb b/spec/services/ci/stop_environments_service_spec.rb
index c3e1af3afe2..6f7d1a5d28d 100644
--- a/spec/services/ci/stop_environments_service_spec.rb
+++ b/spec/services/ci/stop_environments_service_spec.rb
@@ -9,7 +9,8 @@ describe Ci::StopEnvironmentsService, services: true do
describe '#execute' do
context 'when environment with review app exists' do
before do
- create(:environment, :with_review_app, project: project)
+ create(:environment, :with_review_app, project: project,
+ ref: 'feature')
end
context 'when user has permission to stop environment' do
@@ -17,8 +18,16 @@ describe Ci::StopEnvironmentsService, services: true do
project.team << [user, :developer]
end
- it 'stops environment' do
- expect_environment_stopped_on('master')
+ context 'when environment is associated with removed branch' do
+ it 'stops environment' do
+ expect_environment_stopped_on('feature')
+ end
+ end
+
+ context 'when environment is associated with different branch' do
+ it 'does not stop environment' do
+ expect_environment_not_stopped_on('master')
+ end
end
context 'when specified branch does not exist' do
@@ -40,7 +49,7 @@ describe Ci::StopEnvironmentsService, services: true do
end
it 'does not stop environment' do
- expect_environment_not_stopped_on('master')
+ expect_environment_not_stopped_on('feature')
end
end
end