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>2020-04-09 18:09:29 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-09 18:09:29 +0300
commit209bd8cf1f542f6ba2a069b368a9187faa871e96 (patch)
tree6b77dc8183135b8316cc70c8dbc9c4e7c18cf05a /spec/lib/gitlab/git/diff_stats_collection_spec.rb
parenta9ced7da447785c57477b3d8dbccc73a78cface1 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/git/diff_stats_collection_spec.rb')
-rw-r--r--spec/lib/gitlab/git/diff_stats_collection_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/lib/gitlab/git/diff_stats_collection_spec.rb b/spec/lib/gitlab/git/diff_stats_collection_spec.rb
index b07690ef39c..82d15a49062 100644
--- a/spec/lib/gitlab/git/diff_stats_collection_spec.rb
+++ b/spec/lib/gitlab/git/diff_stats_collection_spec.rb
@@ -29,4 +29,16 @@ describe Gitlab::Git::DiffStatsCollection do
expect(collection.paths).to eq %w[foo bar]
end
end
+
+ describe '#real_size' do
+ it 'returns the number of modified files' do
+ expect(collection.real_size).to eq('2')
+ end
+
+ it 'returns capped number when it is bigger than max_files' do
+ allow(::Commit).to receive(:max_diff_options).and_return(max_files: 1)
+
+ expect(collection.real_size).to eq('1+')
+ end
+ end
end