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>2020-03-10 09:08:07 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-10 09:08:07 +0300
commit232655bf32cd474d54de357b65ef43d77271117c (patch)
treed176e36660e41bb2b629237639015d4dde7d4414 /spec/support
parentf5ae9d0960aa422a65a2a22e230100257dddb9ed (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support')
-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 }