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')
-rw-r--r--spec/views/admin/application_settings/_repository_check.html.haml_spec.rb75
-rw-r--r--spec/views/admin/application_settings/general.html.haml_spec.rb29
2 files changed, 104 insertions, 0 deletions
diff --git a/spec/views/admin/application_settings/_repository_check.html.haml_spec.rb b/spec/views/admin/application_settings/_repository_check.html.haml_spec.rb
new file mode 100644
index 00000000000..fbabc890a8b
--- /dev/null
+++ b/spec/views/admin/application_settings/_repository_check.html.haml_spec.rb
@@ -0,0 +1,75 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe 'admin/application_settings/_repository_check.html.haml' do
+ let_it_be(:user) { create(:admin) }
+ let_it_be(:application_setting) { build(:application_setting) }
+
+ before do
+ assign(:application_setting, application_setting)
+ allow(view).to receive(:current_user).and_return(user)
+ end
+
+ describe 'repository checks' do
+ it 'has the setting subsection' do
+ render
+
+ expect(rendered).to have_content('Repository checks')
+ end
+
+ it 'renders the correct setting subsection content' do
+ render
+
+ expect(rendered).to have_field('Enable repository checks')
+ expect(rendered).to have_link(
+ 'Clear all repository checks',
+ href: clear_repository_check_states_admin_application_settings_path
+ )
+ end
+ end
+
+ describe 'housekeeping' do
+ it 'has the setting subsection' do
+ render
+
+ expect(rendered).to have_content('Housekeeping')
+ end
+
+ it 'renders the correct setting subsection content' do
+ render
+
+ expect(rendered).to have_field('Enable automatic repository housekeeping')
+ expect(rendered).to have_field('Incremental repack period')
+ expect(rendered).to have_field('Full repack period')
+ expect(rendered).to have_field('Git GC period')
+ end
+ end
+
+ describe 'inactive project deletion' do
+ let_it_be(:application_setting) do
+ build(:application_setting,
+ delete_inactive_projects: true,
+ inactive_projects_delete_after_months: 2,
+ inactive_projects_min_size_mb: 250,
+ inactive_projects_send_warning_email_after_months: 1
+ )
+ end
+
+ it 'has the setting subsection' do
+ render
+
+ expect(rendered).to have_content('Inactive project deletion')
+ end
+
+ it 'renders the correct setting subsection content' do
+ render
+
+ expect(rendered).to have_selector('.js-inactive-project-deletion-form')
+ expect(rendered).to have_selector('[data-delete-inactive-projects="true"]')
+ expect(rendered).to have_selector('[data-inactive-projects-delete-after-months="2"]')
+ expect(rendered).to have_selector('[data-inactive-projects-min-size-mb="250"]')
+ expect(rendered).to have_selector('[data-inactive-projects-send-warning-email-after-months="1"]')
+ end
+ end
+end
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 503e41eabc9..3614090d3cb 100644
--- a/spec/views/admin/application_settings/general.html.haml_spec.rb
+++ b/spec/views/admin/application_settings/general.html.haml_spec.rb
@@ -68,4 +68,33 @@ RSpec.describe 'admin/application_settings/general.html.haml' do
expect(rendered).not_to have_css('#js-add-license-toggle')
end
end
+
+ describe 'jira connect application key' do
+ it 'shows the jira connect application key section' do
+ render
+
+ expect(rendered).to have_css('#js-jira_connect-settings')
+ end
+
+ context 'when the jira_connect_oauth feature flag is disabled' do
+ before do
+ stub_feature_flags(jira_connect_oauth: false)
+ end
+
+ it 'does not show the jira connect application key section' do
+ render
+
+ expect(rendered).not_to have_css('#js-jira_connect-settings')
+ end
+ end
+ end
+
+ describe 'sign-up restrictions' do
+ it 'renders js-signup-form tag' do
+ render
+
+ expect(rendered).to match 'id="js-signup-form"'
+ expect(rendered).to match ' data-minimum-password-length='
+ end
+ end
end