From 232655bf32cd474d54de357b65ef43d77271117c Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 10 Mar 2020 06:08:07 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- .../models/cluster_application_status_shared_examples.rb | 4 +++- .../models/cluster_application_version_shared_examples.rb | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'spec/support/shared_examples') diff --git a/spec/support/shared_examples/models/cluster_application_status_shared_examples.rb b/spec/support/shared_examples/models/cluster_application_status_shared_examples.rb index 6c772ddf897..37f1b33d455 100644 --- a/spec/support/shared_examples/models/cluster_application_status_shared_examples.rb +++ b/spec/support/shared_examples/models/cluster_application_status_shared_examples.rb @@ -264,6 +264,8 @@ RSpec.shared_examples 'cluster application status specs' do |application_name| describe '#available?' do using RSpec::Parameterized::TableSyntax + let_it_be(:cluster) { create(:cluster, :provided_by_gcp) } + where(:trait, :available) do :not_installable | false :installable | false @@ -280,7 +282,7 @@ RSpec.shared_examples 'cluster application status specs' do |application_name| end with_them do - subject { build(application_name, trait) } + subject { build(application_name, trait, cluster: cluster) } if params[:available] it { is_expected.to be_available } diff --git a/spec/support/shared_examples/models/cluster_application_version_shared_examples.rb b/spec/support/shared_examples/models/cluster_application_version_shared_examples.rb index e293467774e..cf7010c48c2 100644 --- a/spec/support/shared_examples/models/cluster_application_version_shared_examples.rb +++ b/spec/support/shared_examples/models/cluster_application_version_shared_examples.rb @@ -2,16 +2,18 @@ RSpec.shared_examples 'cluster application version specs' do |application_name| describe 'update_available?' do + let_it_be(:cluster) { create(:cluster, :provided_by_gcp) } + let(:version) { '0.0.0' } - subject { create(application_name, :installed, version: version).update_available? } + subject { build(application_name, :installed, version: version, cluster: cluster).update_available? } context 'version is not the same as VERSION' do it { is_expected.to be_truthy } end context 'version is the same as VERSION' do - let(:application) { build(application_name) } + let(:application) { build(application_name, cluster: cluster) } let(:version) { application.class.const_get(:VERSION, false) } it { is_expected.to be_falsey } -- cgit v1.2.1