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/helpers/projects/settings/branch_rules_helper_spec.rb')
-rw-r--r--spec/helpers/projects/settings/branch_rules_helper_spec.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/helpers/projects/settings/branch_rules_helper_spec.rb b/spec/helpers/projects/settings/branch_rules_helper_spec.rb
new file mode 100644
index 00000000000..35a21f72f11
--- /dev/null
+++ b/spec/helpers/projects/settings/branch_rules_helper_spec.rb
@@ -0,0 +1,25 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe Projects::Settings::BranchRulesHelper, feature_category: :source_code_management do
+ let_it_be(:project) { build_stubbed(:project) }
+
+ describe '#branch_rules_data' do
+ subject(:data) { helper.branch_rules_data(project) }
+
+ it 'returns branch rules data' do
+ expect(data).to match({
+ project_path: project.full_path,
+ protected_branches_path: project_settings_repository_path(project, anchor: 'js-protected-branches-settings'),
+ approval_rules_path: project_settings_merge_requests_path(project,
+ anchor: 'js-merge-request-approval-settings'),
+ status_checks_path: project_settings_merge_requests_path(project, anchor: 'js-merge-request-settings'),
+ branches_path: project_branches_path(project),
+ show_status_checks: 'false',
+ show_approvers: 'false',
+ show_code_owners: 'false'
+ })
+ end
+ end
+end