diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 13:34:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 13:34:06 +0300 |
commit | 859a6fb938bb9ee2a317c46dfa4fcc1af49608f0 (patch) | |
tree | d7f2700abe6b4ffcb2dcfc80631b2d87d0609239 /spec/services/deployments/create_service_spec.rb | |
parent | 446d496a6d000c73a304be52587cd9bbc7493136 (diff) |
Add latest changes from gitlab-org/gitlab@13-9-stable-eev13.9.0-rc42
Diffstat (limited to 'spec/services/deployments/create_service_spec.rb')
-rw-r--r-- | spec/services/deployments/create_service_spec.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/services/deployments/create_service_spec.rb b/spec/services/deployments/create_service_spec.rb index 2d157c9d114..0bb5949ddb1 100644 --- a/spec/services/deployments/create_service_spec.rb +++ b/spec/services/deployments/create_service_spec.rb @@ -41,6 +41,27 @@ RSpec.describe Deployments::CreateService do expect(service.execute).to be_persisted end + + context 'when the last deployment has the same parameters' do + let(:params) do + { + sha: 'b83d6e391c22777fca1ed3012fce84f633d7fed0', + ref: 'master', + tag: false, + status: 'success' + } + end + + it 'does not create a new deployment' do + described_class.new(environment, user, params).execute + + expect(Deployments::UpdateEnvironmentWorker).not_to receive(:perform_async) + expect(Deployments::LinkMergeRequestWorker).not_to receive(:perform_async) + expect(Deployments::ExecuteHooksWorker).not_to receive(:perform_async) + + described_class.new(environment.reload, user, params).execute + end + end end describe '#deployment_attributes' do |