summaryrefslogtreecommitdiff
path: root/spec/models/commit_collection_spec.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-10-03 00:05:59 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-10-03 00:05:59 +0000
commit427b23c12718bea233931431e7d9307881a960c0 (patch)
tree5e15672783c950a5e68dd89517d7888e652e01a7 /spec/models/commit_collection_spec.rb
parent6d60f910762c1a92a07a4afaf1b26962f75ee4b6 (diff)
downloadgitlab-ce-427b23c12718bea233931431e7d9307881a960c0.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/models/commit_collection_spec.rb')
-rw-r--r--spec/models/commit_collection_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/models/commit_collection_spec.rb b/spec/models/commit_collection_spec.rb
index a8957bbfdd0..d49b71db5f8 100644
--- a/spec/models/commit_collection_spec.rb
+++ b/spec/models/commit_collection_spec.rb
@@ -149,6 +149,17 @@ describe CommitCollection do
collection.enrich!
end
+
+ it 'returns the original commit if the commit could not be lazy loaded' do
+ collection = described_class.new(project, [hash_commit])
+ unexisting_lazy_commit = Commit.lazy(project, Gitlab::Git::BLANK_SHA)
+
+ expect(Commit).to receive(:lazy).with(project, hash_commit.id).and_return(unexisting_lazy_commit)
+
+ collection.enrich!
+
+ expect(collection.commits).to contain_exactly(hash_commit)
+ end
end
end