summaryrefslogtreecommitdiff
path: root/spec/support/shared_examples
diff options
context:
space:
mode:
Diffstat (limited to 'spec/support/shared_examples')
-rw-r--r--spec/support/shared_examples/models/cluster_application_status_shared_examples.rb4
-rw-r--r--spec/support/shared_examples/models/cluster_application_version_shared_examples.rb6
2 files changed, 7 insertions, 3 deletions
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 }