diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-06 03:07:48 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-12-06 03:07:48 +0300 |
commit | 2349eabc1a473bfb70555f0ce6d3d808cecb181d (patch) | |
tree | 0dae6a2a6810f2198eed42b7f9566ebf9c292468 /spec/lib/gitlab/diff | |
parent | 134fe182008dc13a16f12d723aa73771efb1a6a2 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/diff')
-rw-r--r-- | spec/lib/gitlab/diff/file_collection/merge_request_diff_batch_spec.rb | 4 | ||||
-rw-r--r-- | spec/lib/gitlab/diff/file_collection/merge_request_diff_spec.rb | 7 |
2 files changed, 10 insertions, 1 deletions
diff --git a/spec/lib/gitlab/diff/file_collection/merge_request_diff_batch_spec.rb b/spec/lib/gitlab/diff/file_collection/merge_request_diff_batch_spec.rb index 265c6260ca9..7e945d1d140 100644 --- a/spec/lib/gitlab/diff/file_collection/merge_request_diff_batch_spec.rb +++ b/spec/lib/gitlab/diff/file_collection/merge_request_diff_batch_spec.rb @@ -123,4 +123,8 @@ describe Gitlab::Diff::FileCollection::MergeRequestDiffBatch do collection_default_args) end end + + it_behaves_like 'cacheable diff collection' do + let(:cacheable_files_count) { batch_size } + end end diff --git a/spec/lib/gitlab/diff/file_collection/merge_request_diff_spec.rb b/spec/lib/gitlab/diff/file_collection/merge_request_diff_spec.rb index 7f207d5d2ee..d8f1fd26aeb 100644 --- a/spec/lib/gitlab/diff/file_collection/merge_request_diff_spec.rb +++ b/spec/lib/gitlab/diff/file_collection/merge_request_diff_spec.rb @@ -4,7 +4,8 @@ require 'spec_helper' describe Gitlab::Diff::FileCollection::MergeRequestDiff do let(:merge_request) { create(:merge_request) } - let(:subject) { described_class.new(merge_request.merge_request_diff, diff_options: nil) } + let(:diffable) { merge_request.merge_request_diff } + let(:subject) { described_class.new(diffable, diff_options: nil) } let(:diff_files) { subject.diff_files } describe '#diff_files' do @@ -52,6 +53,10 @@ describe Gitlab::Diff::FileCollection::MergeRequestDiff do let(:stub_path) { '.gitignore' } end + it_behaves_like 'cacheable diff collection' do + let(:cacheable_files_count) { diffable.size.to_i } + end + it 'returns a valid instance of a DiffCollection' do expect(diff_files).to be_a(Gitlab::Git::DiffCollection) end |