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:
Diffstat (limited to 'spec/views/admin/application_settings/general.html.haml_spec.rb')
-rw-r--r--spec/views/admin/application_settings/general.html.haml_spec.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/views/admin/application_settings/general.html.haml_spec.rb b/spec/views/admin/application_settings/general.html.haml_spec.rb
index dd49de8f880..861f3fffa83 100644
--- a/spec/views/admin/application_settings/general.html.haml_spec.rb
+++ b/spec/views/admin/application_settings/general.html.haml_spec.rb
@@ -110,4 +110,30 @@ RSpec.describe 'admin/application_settings/general.html.haml' do
end
end
end
+
+ describe 'instance-level code suggestions settings', feature_category: :code_suggestions do
+ before do
+ allow(::Gitlab).to receive(:org_or_com?).and_return(gitlab_org_or_com?)
+
+ render
+ end
+
+ context 'when on .com or .org' do
+ let(:gitlab_org_or_com?) { true }
+
+ it 'does not render the form' do
+ expect(rendered).not_to have_field('application_setting_instance_level_code_suggestions_enabled')
+ expect(rendered).not_to have_field('application_setting_ai_access_token')
+ end
+ end
+
+ context 'when not on .com and not on .org' do
+ let(:gitlab_org_or_com?) { false }
+
+ it 'renders the form' do
+ expect(rendered).to have_field('application_setting_instance_level_code_suggestions_enabled')
+ expect(rendered).to have_field('application_setting_ai_access_token')
+ end
+ end
+ end
end