diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-05-19 10:33:21 +0300 |
commit | 36a59d088eca61b834191dacea009677a96c052f (patch) | |
tree | e4f33972dab5d8ef79e3944a9f403035fceea43f /spec/support/helpers/project_helpers.rb | |
parent | a1761f15ec2cae7c7f7bbda39a75494add0dfd6f (diff) |
Add latest changes from gitlab-org/gitlab@15-0-stable-eev15.0.0-rc42
Diffstat (limited to 'spec/support/helpers/project_helpers.rb')
-rw-r--r-- | spec/support/helpers/project_helpers.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/support/helpers/project_helpers.rb b/spec/support/helpers/project_helpers.rb index 89f0163b4b6..2ea6405e48c 100644 --- a/spec/support/helpers/project_helpers.rb +++ b/spec/support/helpers/project_helpers.rb @@ -24,4 +24,20 @@ module ProjectHelpers project.update!(params) end + + def create_project_with_statistics(namespace = nil, with_data: false, size_multiplier: 1) + project = namespace.present? ? create(:project, namespace: namespace) : create(:project) + project.tap do |p| + create(:project_statistics, project: p, with_data: with_data, size_multiplier: size_multiplier) + end + end + + def grace_months_after_deletion_notification + (::Gitlab::CurrentSettings.inactive_projects_delete_after_months - + ::Gitlab::CurrentSettings.inactive_projects_send_warning_email_after_months).months + end + + def deletion_date + Date.parse(grace_months_after_deletion_notification.from_now.to_s).to_s + end end |