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:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-07-20 12:55:51 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-07-20 12:55:51 +0300
commite8d2c2579383897a1dd7f9debd359abe8ae8373d (patch)
treec42be41678c2586d49a75cabce89322082698334 /spec/views/admin/application_settings
parentfc845b37ec3a90aaa719975f607740c22ba6a113 (diff)
Add latest changes from gitlab-org/gitlab@14-1-stable-eev14.1.0-rc42
Diffstat (limited to 'spec/views/admin/application_settings')
-rw-r--r--spec/views/admin/application_settings/_eks.html.haml_spec.rb1
-rw-r--r--spec/views/admin/application_settings/_package_registry.html.haml_spec.rb1
-rw-r--r--spec/views/admin/application_settings/ci_cd.html.haml_spec.rb56
-rw-r--r--spec/views/admin/application_settings/repository.html.haml_spec.rb2
4 files changed, 59 insertions, 1 deletions
diff --git a/spec/views/admin/application_settings/_eks.html.haml_spec.rb b/spec/views/admin/application_settings/_eks.html.haml_spec.rb
index 2f45eaadc9f..e407970c7a4 100644
--- a/spec/views/admin/application_settings/_eks.html.haml_spec.rb
+++ b/spec/views/admin/application_settings/_eks.html.haml_spec.rb
@@ -4,6 +4,7 @@ require 'spec_helper'
RSpec.describe 'admin/application_settings/_eks' do
let_it_be(:admin) { create(:admin) }
+
let(:page) { Capybara::Node::Simple.new(rendered) }
before do
diff --git a/spec/views/admin/application_settings/_package_registry.html.haml_spec.rb b/spec/views/admin/application_settings/_package_registry.html.haml_spec.rb
index e0aa2fc8d56..72e32643a49 100644
--- a/spec/views/admin/application_settings/_package_registry.html.haml_spec.rb
+++ b/spec/views/admin/application_settings/_package_registry.html.haml_spec.rb
@@ -6,6 +6,7 @@ RSpec.describe 'admin/application_settings/_package_registry' do
let_it_be(:admin) { create(:admin) }
let_it_be(:default_plan_limits) { create(:plan_limits, :default_plan, :with_package_file_sizes) }
let_it_be(:application_setting) { build(:application_setting) }
+
let(:page) { Capybara::Node::Simple.new(rendered) }
before do
diff --git a/spec/views/admin/application_settings/ci_cd.html.haml_spec.rb b/spec/views/admin/application_settings/ci_cd.html.haml_spec.rb
new file mode 100644
index 00000000000..4d40bf5671e
--- /dev/null
+++ b/spec/views/admin/application_settings/ci_cd.html.haml_spec.rb
@@ -0,0 +1,56 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe 'admin/application_settings/ci_cd.html.haml' do
+ let_it_be(:app_settings) { build(:application_setting) }
+ let_it_be(:user) { create(:admin) }
+
+ let_it_be(:default_plan_limits) { create(:plan_limits, :default_plan, :with_package_file_sizes) }
+
+ before do
+ assign(:application_setting, app_settings)
+ assign(:plans, [default_plan_limits.plan])
+ allow(view).to receive(:current_user).and_return(user)
+ end
+
+ describe 'CI CD Runner Registration' do
+ context 'when feature flag is enabled' do
+ before do
+ stub_feature_flags(runner_registration_control: true)
+ end
+
+ it 'has the setting section' do
+ render
+
+ expect(rendered).to have_css("#js-runner-settings")
+ end
+
+ it 'renders the correct setting section content' do
+ render
+
+ expect(rendered).to have_content("Runner registration")
+ expect(rendered).to have_content("If no options are selected, only administrators can register runners.")
+ end
+ end
+
+ context 'when feature flag is disabled' do
+ before do
+ stub_feature_flags(runner_registration_control: false)
+ end
+
+ it 'does not have the setting section' do
+ render
+
+ expect(rendered).not_to have_css("#js-runner-settings")
+ end
+
+ it 'does not render the correct setting section content' do
+ render
+
+ expect(rendered).not_to have_content("Runner registration")
+ expect(rendered).not_to have_content("If no options are selected, only administrators can register runners.")
+ end
+ end
+ end
+end
diff --git a/spec/views/admin/application_settings/repository.html.haml_spec.rb b/spec/views/admin/application_settings/repository.html.haml_spec.rb
index 47cadd29e33..30047878b0f 100644
--- a/spec/views/admin/application_settings/repository.html.haml_spec.rb
+++ b/spec/views/admin/application_settings/repository.html.haml_spec.rb
@@ -22,7 +22,7 @@ RSpec.describe 'admin/application_settings/repository.html.haml' do
render
expect(rendered).to have_content("Default initial branch name")
- expect(rendered).to have_content("Set the default name of the initial branch when creating new repositories through the user interface.")
+ expect(rendered).to have_content("The default name for the initial branch of new repositories created in the instance.")
end
end
end