summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
authorwalkafwalka <2865898-walkafwalka@users.noreply.gitlab.com>2019-03-07 13:51:43 -0800
committerwalkafwalka <2865898-walkafwalka@users.noreply.gitlab.com>2019-03-07 15:25:48 -0800
commit460797dec3dc143943390e86a09d6e6b45a465d8 (patch)
treea5495703f3bfd1152929c84853322cd9a6812f15 /spec/models
parent31cf53df4d766ef58d6d5be60d5fa2e380406fc8 (diff)
downloadgitlab-ce-ingress-hostnames.tar.gz
Add support for ingress hostnamesingress-hostnames
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/clusters/applications/ingress_spec.rb8
-rw-r--r--spec/models/clusters/applications/jupyter_spec.rb7
-rw-r--r--spec/models/clusters/applications/knative_spec.rb8
-rw-r--r--spec/models/clusters/cluster_spec.rb1
4 files changed, 24 insertions, 0 deletions
diff --git a/spec/models/clusters/applications/ingress_spec.rb b/spec/models/clusters/applications/ingress_spec.rb
index d5fd42509a3..a40fa988287 100644
--- a/spec/models/clusters/applications/ingress_spec.rb
+++ b/spec/models/clusters/applications/ingress_spec.rb
@@ -56,6 +56,14 @@ describe Clusters::Applications::Ingress do
expect(ClusterWaitForIngressIpAddressWorker).not_to have_received(:perform_in)
end
end
+
+ context 'when there is already an external_hostname' do
+ let(:application) { create(:clusters_applications_ingress, :installed, external_hostname: 'localhost.localdomain') }
+
+ it 'does not schedule a ClusterWaitForIngressIpAddressWorker' do
+ expect(ClusterWaitForIngressIpAddressWorker).not_to have_received(:perform_in)
+ end
+ end
end
describe '#install_command' do
diff --git a/spec/models/clusters/applications/jupyter_spec.rb b/spec/models/clusters/applications/jupyter_spec.rb
index 6e58f3ad699..2967c4076c6 100644
--- a/spec/models/clusters/applications/jupyter_spec.rb
+++ b/spec/models/clusters/applications/jupyter_spec.rb
@@ -26,6 +26,13 @@ describe Clusters::Applications::Jupyter do
it { expect(jupyter).to be_installable }
end
+
+ context 'when ingress is installed and external_hostname is assigned' do
+ let(:ingress) { create(:clusters_applications_ingress, :installed, external_hostname: 'localhost.localdomain') }
+ let(:jupyter) { create(:clusters_applications_jupyter, cluster: ingress.cluster) }
+
+ it { expect(jupyter).to be_installable }
+ end
end
describe '#install_command' do
diff --git a/spec/models/clusters/applications/knative_spec.rb b/spec/models/clusters/applications/knative_spec.rb
index 4884a5927fb..bf425a2617c 100644
--- a/spec/models/clusters/applications/knative_spec.rb
+++ b/spec/models/clusters/applications/knative_spec.rb
@@ -64,6 +64,14 @@ describe Clusters::Applications::Knative do
expect(ClusterWaitForIngressIpAddressWorker).not_to have_received(:perform_in)
end
end
+
+ context 'when there is already an external_hostname' do
+ let(:application) { create(:clusters_applications_knative, :installed, external_hostname: 'localhost.localdomain') }
+
+ it 'does not schedule a ClusterWaitForIngressIpAddressWorker' do
+ expect(ClusterWaitForIngressIpAddressWorker).not_to have_received(:perform_in)
+ end
+ end
end
shared_examples 'a command' do
diff --git a/spec/models/clusters/cluster_spec.rb b/spec/models/clusters/cluster_spec.rb
index 3feed4e9718..acbcdc7d170 100644
--- a/spec/models/clusters/cluster_spec.rb
+++ b/spec/models/clusters/cluster_spec.rb
@@ -31,6 +31,7 @@ describe Clusters::Cluster do
it { is_expected.to delegate_method(:available?).to(:application_prometheus).with_prefix }
it { is_expected.to delegate_method(:available?).to(:application_knative).with_prefix }
it { is_expected.to delegate_method(:external_ip).to(:application_ingress).with_prefix }
+ it { is_expected.to delegate_method(:external_hostname).to(:application_ingress).with_prefix }
it { is_expected.to respond_to :project }