summaryrefslogtreecommitdiff
path: root/spec/views/admin/application_settings/integrations.html.haml_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/views/admin/application_settings/integrations.html.haml_spec.rb')
-rw-r--r--spec/views/admin/application_settings/integrations.html.haml_spec.rb34
1 files changed, 34 insertions, 0 deletions
diff --git a/spec/views/admin/application_settings/integrations.html.haml_spec.rb b/spec/views/admin/application_settings/integrations.html.haml_spec.rb
new file mode 100644
index 00000000000..392d43ef2d4
--- /dev/null
+++ b/spec/views/admin/application_settings/integrations.html.haml_spec.rb
@@ -0,0 +1,34 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+describe 'admin/application_settings/integrations.html.haml' do
+ let(:app_settings) { build(:application_setting) }
+
+ describe 'sourcegraph integration' do
+ let(:sourcegraph_flag) { true }
+
+ before do
+ assign(:application_setting, app_settings)
+ allow(Gitlab::Sourcegraph).to receive(:feature_available?).and_return(sourcegraph_flag)
+ end
+
+ context 'when sourcegraph feature is enabled' do
+ it 'show the form' do
+ render
+
+ expect(rendered).to have_field('application_setting_sourcegraph_enabled')
+ end
+ end
+
+ context 'when sourcegraph feature is disabled' do
+ let(:sourcegraph_flag) { false }
+
+ it 'show the form' do
+ render
+
+ expect(rendered).not_to have_field('application_setting_sourcegraph_enabled')
+ end
+ end
+ end
+end