diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-20 18:09:10 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-20 18:09:10 +0300 |
commit | 6997e3f3d0a714bc67df268989fb089c943330cc (patch) | |
tree | 3749fb3865297df1689624b071d5d80e7783471b /spec/serializers | |
parent | 7ad82cd5d78a4d2c53512cbd1c2584be753f3646 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/serializers')
-rw-r--r-- | spec/serializers/deployment_entity_spec.rb | 12 | ||||
-rw-r--r-- | spec/serializers/environment_serializer_spec.rb | 7 |
2 files changed, 13 insertions, 6 deletions
diff --git a/spec/serializers/deployment_entity_spec.rb b/spec/serializers/deployment_entity_spec.rb index 500d5718bf1..4452ccbcf07 100644 --- a/spec/serializers/deployment_entity_spec.rb +++ b/spec/serializers/deployment_entity_spec.rb @@ -60,12 +60,16 @@ RSpec.describe DeploymentEntity do end context 'when the pipeline has another manual action' do - let(:other_build) { create(:ci_build, :manual, name: 'another deploy', pipeline: pipeline) } - let!(:other_deployment) { create(:deployment, deployable: other_build) } + let!(:other_build) do + create(:ci_build, :manual, name: 'another deploy', + pipeline: pipeline, environment: build.environment) + end + + let!(:other_deployment) { create(:deployment, deployable: build) } it 'returns another manual action' do - expect(subject[:manual_actions].count).to eq(1) - expect(subject[:manual_actions].first[:name]).to eq('another deploy') + expect(subject[:manual_actions].count).to eq(2) + expect(subject[:manual_actions].second[:name]).to eq('another deploy') end context 'when user is a reporter' do diff --git a/spec/serializers/environment_serializer_spec.rb b/spec/serializers/environment_serializer_spec.rb index fe6278084f9..47d2c8b3794 100644 --- a/spec/serializers/environment_serializer_spec.rb +++ b/spec/serializers/environment_serializer_spec.rb @@ -227,8 +227,11 @@ RSpec.describe EnvironmentSerializer do def create_environment_with_associations(project) create(:environment, project: project).tap do |environment| - create(:deployment, :success, environment: environment, project: project) - create(:deployment, :running, environment: environment, project: project) + 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) end end end |