diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-21 21:16:10 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-21 21:16:10 +0300 |
commit | d2f2219fd58e572c10d77183e2f65de8fcc8df96 (patch) | |
tree | 2cde75cd3d994b7febe1349ab61b7a94a95c78cf /spec/models | |
parent | 6323146895db2be6f04846b3c98060b7349207b9 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models')
-rw-r--r-- | spec/models/merge_request_spec.rb | 28 | ||||
-rw-r--r-- | spec/models/project_spec.rb | 16 | ||||
-rw-r--r-- | spec/models/project_statistics_spec.rb | 18 |
3 files changed, 62 insertions, 0 deletions
diff --git a/spec/models/merge_request_spec.rb b/spec/models/merge_request_spec.rb index 2b5f4165d8c..d9606b50bff 100644 --- a/spec/models/merge_request_spec.rb +++ b/spec/models/merge_request_spec.rb @@ -6127,4 +6127,32 @@ RSpec.describe MergeRequest, factory_default: :keep, feature_category: :code_rev it { is_expected.to eq(false) } end end + + describe '#allows_multiple_assignees?' do + let(:merge_request) { build_stubbed(:merge_request) } + + subject(:allows_multiple_assignees?) { merge_request.allows_multiple_assignees? } + + before do + allow(merge_request.project) + .to receive(:allows_multiple_merge_request_assignees?) + .and_return(false) + end + + it { is_expected.to eq(false) } + end + + describe '#allows_multiple_reviewers?' do + let(:merge_request) { build_stubbed(:merge_request) } + + subject(:allows_multiple_reviewers?) { merge_request.allows_multiple_reviewers? } + + before do + allow(merge_request.project) + .to receive(:allows_multiple_merge_request_reviewers?) + .and_return(false) + end + + it { is_expected.to eq(false) } + end end diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index db1754ef991..f7402c273fb 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -8972,6 +8972,22 @@ RSpec.describe Project, factory_default: :keep, feature_category: :groups_and_pr end end + describe '#allows_multiple_merge_request_assignees?' do + let(:project) { build_stubbed(:project) } + + subject(:allows_multiple_merge_request_assignees?) { project.allows_multiple_merge_request_assignees? } + + it { is_expected.to eq(false) } + end + + describe '#allows_multiple_merge_request_reviewers?' do + let(:project) { build_stubbed(:project) } + + subject(:allows_multiple_merge_request_reviewers?) { project.allows_multiple_merge_request_reviewers? } + + it { is_expected.to eq(false) } + end + private def finish_job(export_job) diff --git a/spec/models/project_statistics_spec.rb b/spec/models/project_statistics_spec.rb index 211ac257c53..d21d29aa469 100644 --- a/spec/models/project_statistics_spec.rb +++ b/spec/models/project_statistics_spec.rb @@ -647,4 +647,22 @@ RSpec.describe ProjectStatistics do end end end + + describe '#export_size' do + it 'does not include artifacts & packages size' do + statistics.update!( + repository_size: 3.gigabytes, + wiki_size: 3.gigabytes, + lfs_objects_size: 3.gigabytes, + build_artifacts_size: 3.gigabytes, + packages_size: 3.gigabytes, + snippets_size: 3.gigabytes, + uploads_size: 3.gigabytes + ) + + statistics.refresh_storage_size! + + expect(statistics.reload.export_size).to eq(15.gigabytes) + end + end end |