summaryrefslogtreecommitdiff
path: root/spec/models/clusters/applications/ingress_spec.rb
diff options
context:
space:
mode:
authorJoão Cunha <j.a.cunha@gmail.com>2019-07-02 12:59:59 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2019-07-02 12:59:59 +0000
commit637e510da147f73587faa0414c67638c2e4729f7 (patch)
tree14d568eee2e7b9be3524bb05efcfdbd2daa17f89 /spec/models/clusters/applications/ingress_spec.rb
parent34a22b831135faeb8f4c70a3b8a3b8d525ccd164 (diff)
downloadgitlab-ce-637e510da147f73587faa0414c67638c2e4729f7.tar.gz
Enables ingress for uninstallation
- JupyterHub must not be available (installed or updated)
Diffstat (limited to 'spec/models/clusters/applications/ingress_spec.rb')
-rw-r--r--spec/models/clusters/applications/ingress_spec.rb16
1 files changed, 15 insertions, 1 deletions
diff --git a/spec/models/clusters/applications/ingress_spec.rb b/spec/models/clusters/applications/ingress_spec.rb
index 292ddabd2d8..057517d3820 100644
--- a/spec/models/clusters/applications/ingress_spec.rb
+++ b/spec/models/clusters/applications/ingress_spec.rb
@@ -21,7 +21,21 @@ describe Clusters::Applications::Ingress do
describe '#can_uninstall?' do
subject { ingress.can_uninstall? }
- it { is_expected.to be_falsey }
+ it 'returns true if application_jupyter_nil_or_installable? AND external_ip_or_hostname? are true' do
+ ingress.external_ip = 'IP'
+
+ is_expected.to be_truthy
+ end
+
+ it 'returns false if application_jupyter_nil_or_installable? is false' do
+ create(:clusters_applications_jupyter, :installed, cluster: ingress.cluster)
+
+ is_expected.to be_falsey
+ end
+
+ it 'returns false if external_ip_or_hostname? is false' do
+ is_expected.to be_falsey
+ end
end
describe '#make_installed!' do