diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-20 12:05:52 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-20 12:05:52 +0000 |
commit | d46287cc16ba244720c6d5c00491944336972988 (patch) | |
tree | bcb8129932d9b734334bfcd67dbcf7b1185d0280 /spec/models | |
parent | 8ac91ecfd1bb445a0a1572b3c0885c41c9037e8a (diff) | |
download | gitlab-ce-d46287cc16ba244720c6d5c00491944336972988.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/clusters/cluster_spec.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/models/clusters/cluster_spec.rb b/spec/models/clusters/cluster_spec.rb index 9afbe6328ca..b8a6fd6f914 100644 --- a/spec/models/clusters/cluster_spec.rb +++ b/spec/models/clusters/cluster_spec.rb @@ -38,6 +38,15 @@ describe Clusters::Cluster, :use_clean_rails_memory_store_caching do it { is_expected.to respond_to :project } + describe 'applications have inverse_of: :cluster option' do + let(:cluster) { create(:cluster) } + let!(:helm) { create(:clusters_applications_helm, cluster: cluster) } + + it 'does not do a third query when referencing cluster again' do + expect { cluster.application_helm.cluster }.not_to exceed_query_limit(2) + end + end + describe '.enabled' do subject { described_class.enabled } |