diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-09 15:11:14 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-09 15:11:14 +0300 |
commit | 3fd585614449ccab7fdab083f210c09eb16a6ed2 (patch) | |
tree | 225d8bdfcd0bfd5efe0da44348dd97be558be288 /spec/models/clusters | |
parent | 8b50d36626f3a71a2d8552a316d700510559b0de (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/clusters')
-rw-r--r-- | spec/models/clusters/cluster_spec.rb | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/spec/models/clusters/cluster_spec.rb b/spec/models/clusters/cluster_spec.rb index d501325dd90..99932dc27d1 100644 --- a/spec/models/clusters/cluster_spec.rb +++ b/spec/models/clusters/cluster_spec.rb @@ -188,8 +188,15 @@ RSpec.describe Clusters::Cluster, :use_clean_rails_memory_store_caching, context 'cluster has multiple successful deployment with environment' do let!(:environment) { create(:environment) } - let!(:deployment) { create(:deployment, :success, cluster: cluster, environment: environment) } - let!(:deployment_2) { create(:deployment, :success, cluster: cluster, environment: environment) } + let!(:deployment) { create(:deployment, :on_cluster, :success, environment: environment) } + let!(:deployment_2) { create(:deployment, :on_cluster, :success, environment: environment) } + + before do + deployment.deployment_cluster.update!(cluster: cluster) + deployment_2.deployment_cluster.update!(cluster: cluster) + deployment.reload + deployment_2.reload + end it { is_expected.to include(cluster) } @@ -200,9 +207,9 @@ RSpec.describe Clusters::Cluster, :use_clean_rails_memory_store_caching, context 'cluster has only failed deployment with environment' do let!(:environment) { create(:environment) } - let!(:deployment) { create(:deployment, :failed, cluster: cluster, environment: environment) } + let!(:deployment) { create(:deployment, :failed, :on_cluster, environment: environment) } - it { is_expected.not_to include(cluster) } + it { is_expected.not_to include(deployment.cluster) } end context 'cluster does not have any deployment' do |