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-08-22 21:10:26 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-08-22 21:10:26 +0300
commita3ffaa242bb3b9b4c95a8223ca800126887e3a82 (patch)
treebaf3d90b38dd8c93873498c838e8b0894c74d3ea /spec/models
parentadaa4599f18149e0fb8f8e120a7ed8e7d05e36be (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/deployment_spec.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/models/deployment_spec.rb b/spec/models/deployment_spec.rb
index 0a4ee73f3d3..c5ce18739aa 100644
--- a/spec/models/deployment_spec.rb
+++ b/spec/models/deployment_spec.rb
@@ -74,6 +74,27 @@ RSpec.describe Deployment do
end
end
+ describe '.for_iid' do
+ subject { described_class.for_iid(project, iid) }
+
+ let_it_be(:project) { create(:project, :repository) }
+ let_it_be(:deployment) { create(:deployment, project: project) }
+
+ let(:iid) { deployment.iid }
+
+ it 'finds the deployment' do
+ is_expected.to contain_exactly(deployment)
+ end
+
+ context 'when iid does not match' do
+ let(:iid) { non_existing_record_id }
+
+ it 'does not find the deployment' do
+ is_expected.to be_empty
+ end
+ end
+ end
+
describe '.for_environment_name' do
subject { described_class.for_environment_name(project, environment_name) }