Commit ca13500a authored by Enrique Alcantara's avatar Enrique Alcantara

Hide/show ingress external ip help text

Use not_to instead of to__not
parent 4ac99465
...@@ -33,9 +33,9 @@ ...@@ -33,9 +33,9 @@
- auto_devops_url = help_page_path('topics/autodevops/index') - auto_devops_url = help_page_path('topics/autodevops/index')
- auto_devops_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: auto_devops_url } - auto_devops_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: auto_devops_url }
= s_('ClusterIntegration|Specifying a domain will allow you to use Auto Review Apps and Auto Deploy stages for %{auto_devops_start}Auto DevOps%{auto_devops_end}. The domain should have a wildcard DNS configured matching the domain.').html_safe % { auto_devops_start: auto_devops_start, auto_devops_end: '</a>'.html_safe } = s_('ClusterIntegration|Specifying a domain will allow you to use Auto Review Apps and Auto Deploy stages for %{auto_devops_start}Auto DevOps%{auto_devops_end}. The domain should have a wildcard DNS configured matching the domain.').html_safe % { auto_devops_start: auto_devops_start, auto_devops_end: '</a>'.html_safe }
- if @cluster.application_ingress_external_ip.present? %span{ :class => ["js-ingress-domain-help-text", ("hide" unless @cluster.application_ingress_external_ip.present?)] }
= s_('ClusterIntegration|Alternatively') = s_('ClusterIntegration|Alternatively')
%code #{@cluster.application_ingress_external_ip}.nip.io %code{ :class => "js-ingress-external-ip-help-text" } #{@cluster.application_ingress_external_ip}.nip.io
= s_('ClusterIntegration| can be used instead of a custom domain.') = s_('ClusterIntegration| can be used instead of a custom domain.')
- custom_domain_url = help_page_path('user/project/clusters/index', anchor: 'pointing-your-dns-at-the-external-endpoint') - custom_domain_url = help_page_path('user/project/clusters/index', anchor: 'pointing-your-dns-at-the-external-endpoint')
- custom_domain_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: custom_domain_url } - custom_domain_start = '<a href="%{url}" target="_blank" rel="noopener noreferrer">'.html_safe % { url: custom_domain_url }
......
...@@ -4,6 +4,8 @@ require 'spec_helper' ...@@ -4,6 +4,8 @@ require 'spec_helper'
describe 'Clusterable > Show page' do describe 'Clusterable > Show page' do
let(:current_user) { create(:user) } let(:current_user) { create(:user) }
let(:cluster_ingress_help_text_selector) { '.js-ingress-domain-help-text' }
let(:hide_modifier_selector) { '.hide' }
before do before do
sign_in(current_user) sign_in(current_user)
...@@ -35,7 +37,7 @@ describe 'Clusterable > Show page' do ...@@ -35,7 +37,7 @@ describe 'Clusterable > Show page' do
it 'shows help text with the domain as an alternative to custom domain' do it 'shows help text with the domain as an alternative to custom domain' do
within '#cluster-integration' do within '#cluster-integration' do
expect(page).to have_content('Alternatively 192.168.1.100.nip.io can be used instead of a custom domain') expect(find(cluster_ingress_help_text_selector)).not_to match_css(hide_modifier_selector)
end end
end end
end end
...@@ -45,7 +47,7 @@ describe 'Clusterable > Show page' do ...@@ -45,7 +47,7 @@ describe 'Clusterable > Show page' do
visit cluster_path visit cluster_path
within '#cluster-integration' do within '#cluster-integration' do
expect(page).not_to have_content('can be used instead of a custom domain.') expect(find(cluster_ingress_help_text_selector)).to match_css(hide_modifier_selector)
end end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment