From 71786ddc8e28fbd3cb3fcc4b3ff15e5962a1c82e Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Mon, 20 Feb 2023 13:49:51 +0000 Subject: Add latest changes from gitlab-org/gitlab@15-9-stable-ee --- spec/models/deployment_spec.rb | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'spec/models/deployment_spec.rb') diff --git a/spec/models/deployment_spec.rb b/spec/models/deployment_spec.rb index f0fdc62e6c7..46a1b4ce588 100644 --- a/spec/models/deployment_spec.rb +++ b/spec/models/deployment_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Deployment do +RSpec.describe Deployment, feature_category: :continuous_delivery do subject { build(:deployment) } it { is_expected.to belong_to(:project).required } @@ -164,7 +164,8 @@ RSpec.describe Deployment do freeze_time do expect(Deployments::HooksWorker) .to receive(:perform_async) - .with(deployment_id: deployment.id, status: 'running', status_changed_at: Time.current) + .with(hash_including({ 'deployment_id' => deployment.id, 'status' => 'running', + 'status_changed_at' => Time.current.to_s })) deployment.run! end @@ -200,8 +201,9 @@ RSpec.describe Deployment do it 'executes Deployments::HooksWorker asynchronously' do freeze_time do expect(Deployments::HooksWorker) - .to receive(:perform_async) - .with(deployment_id: deployment.id, status: 'success', status_changed_at: Time.current) + .to receive(:perform_async) + .with(hash_including({ 'deployment_id' => deployment.id, 'status' => 'success', + 'status_changed_at' => Time.current.to_s })) deployment.succeed! end @@ -231,7 +233,8 @@ RSpec.describe Deployment do freeze_time do expect(Deployments::HooksWorker) .to receive(:perform_async) - .with(deployment_id: deployment.id, status: 'failed', status_changed_at: Time.current) + .with(hash_including({ 'deployment_id' => deployment.id, 'status' => 'failed', + 'status_changed_at' => Time.current.to_s })) deployment.drop! end @@ -261,8 +264,8 @@ RSpec.describe Deployment do freeze_time do expect(Deployments::HooksWorker) .to receive(:perform_async) - .with(deployment_id: deployment.id, status: 'canceled', status_changed_at: Time.current) - + .with(hash_including({ 'deployment_id' => deployment.id, 'status' => 'canceled', + 'status_changed_at' => Time.current.to_s })) deployment.cancel! end end -- cgit v1.2.3