diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-20 00:10:01 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-20 00:10:01 +0300 |
commit | 7361375554b55ca52e0282bbe6cd063e2848bc2b (patch) | |
tree | 17a82da8e5ecd722da643554d521900d7e60f29b /doc | |
parent | 2f00709f337c76982dfe69cbc62dc3cb148131f2 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc')
-rw-r--r-- | doc/development/testing_guide/best_practices.md | 28 | ||||
-rw-r--r-- | doc/user/application_security/secret_detection/index.md | 2 |
2 files changed, 17 insertions, 13 deletions
diff --git a/doc/development/testing_guide/best_practices.md b/doc/development/testing_guide/best_practices.md index 90267a517b8..02c8ad44033 100644 --- a/doc/development/testing_guide/best_practices.md +++ b/doc/development/testing_guide/best_practices.md @@ -1470,19 +1470,17 @@ under `spec/support/helpers/`. Helpers can be placed in a subfolder if they appl to a certain type of specs only (such as features or requests) but shouldn't be if they apply to multiple type of specs. -Helpers should follow the Rails naming / namespacing convention. For instance -`spec/support/helpers/cycle_analytics_helpers.rb` should define: +Helpers should follow the Rails naming / namespacing convention, where +`spec/support/helpers/` is the root. For instance +`spec/support/helpers/features/iteration_helpers.rb` should define: ```ruby -module Spec - module Support - module Helpers - module CycleAnalyticsHelpers - def create_commit_referencing_issue(issue, branch_name: random_git_name) - project.repository.add_branch(user, branch_name, 'main') - create_commit("Commit for ##{issue.iid}", issue.project, user, branch_name) - end - end +# frozen_string_literal: true + +module Features + module IterationHelpers + def iteration_period(iteration) + "#{iteration.start_date.to_s(:medium)} - #{iteration.due_date.to_s(:medium)}" end end end @@ -1492,8 +1490,14 @@ Helpers should not change the RSpec configuration. For instance, the helpers mod described above should not include: ```ruby +# bad RSpec.configure do |config| - config.include Spec::Support::Helpers::CycleAnalyticsHelpers + config.include Features::IterationHelpers +end + +# good, include in specific spec +RSpec.describe 'Issue Sidebar', feature_category: :team_planning do + include Features::IterationHelpers end ``` diff --git a/doc/user/application_security/secret_detection/index.md b/doc/user/application_security/secret_detection/index.md index 2e6de222ec3..c6928d3679b 100644 --- a/doc/user/application_security/secret_detection/index.md +++ b/doc/user/application_security/secret_detection/index.md @@ -83,7 +83,7 @@ Secret Detection can detect if a secret was added in one commit and removed in a - Commit range - If the `SECRET_DETECTION_LOG_OPTS` variable is set, the secrets analyzer fetches the entire + If the `SECRET_DETECTION_LOG_OPTIONS` variable is set, the secrets analyzer fetches the entire history of the branch or reference the pipeline is being run for. Secret Detection then runs, scanning the commit range specified. |