diff options
Diffstat (limited to 'spec/serializers/deployment_entity_spec.rb')
-rw-r--r-- | spec/serializers/deployment_entity_spec.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/spec/serializers/deployment_entity_spec.rb b/spec/serializers/deployment_entity_spec.rb index 500d5718bf1..a017f7523e9 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].pluck(:name)).to match_array(['test', 'another deploy']) end context 'when user is a reporter' do |