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:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-05-30 18:08:03 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-05-30 18:08:03 +0300
commit02c48d0a6bf00afd66a603253ec59db4e1412392 (patch)
tree0b7ea896f1f535e55e1988f4cb8d105e3983ea7c /spec/serializers
parentf1284938edfc2e033baf2c26ebadf42c526f6432 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/serializers')
-rw-r--r--spec/serializers/environment_serializer_spec.rb26
1 files changed, 20 insertions, 6 deletions
diff --git a/spec/serializers/environment_serializer_spec.rb b/spec/serializers/environment_serializer_spec.rb
index 47d2c8b3794..05644dad151 100644
--- a/spec/serializers/environment_serializer_spec.rb
+++ b/spec/serializers/environment_serializer_spec.rb
@@ -212,7 +212,10 @@ RSpec.describe EnvironmentSerializer do
upcoming_deployment = nil
create(:environment, project: project).tap do |environment|
create(:deployment, :success, environment: environment, project: project)
- last_deployment = create(:deployment, :success, environment: environment, project: project)
+
+ create(:ci_build, :success, project: project).tap do |build|
+ last_deployment = create(:deployment, :success, environment: environment, project: project, deployable: build)
+ end
create(:deployment, :running, environment: environment, project: project)
upcoming_deployment = create(:deployment, :running, environment: environment, project: project)
@@ -227,11 +230,22 @@ RSpec.describe EnvironmentSerializer do
def create_environment_with_associations(project)
create(:environment, project: project).tap do |environment|
- pipeline = create(:ci_pipeline, project: project)
- manual_build = create(:ci_build, :manual, project: project, pipeline: pipeline, environment: environment.name)
- scheduled_build = create(:ci_build, :scheduled, project: project, pipeline: pipeline, environment: environment.name)
- create(:deployment, :success, environment: environment, project: project, deployable: manual_build)
- create(:deployment, :running, environment: environment, project: project, deployable: scheduled_build)
+ create(:ci_pipeline, project: project).tap do |pipeline|
+ create(:ci_build, :manual, project: project, pipeline: pipeline, name: 'stop-action',
+ environment: environment.name)
+
+ create(:ci_build, :scheduled, project: project, pipeline: pipeline,
+ environment: environment.name).tap do |scheduled_build|
+ create(:deployment, :running, environment: environment, project: project,
+ deployable: scheduled_build)
+ end
+
+ create(:ci_build, :success, :manual, project: project, pipeline: pipeline,
+ environment: environment.name).tap do |manual_build|
+ create(:deployment, :success, environment: environment, project: project,
+ deployable: manual_build, on_stop: 'stop-action')
+ end
+ end
end
end
end