summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2019-03-29 10:31:57 +0000
committerKamil Trzciński <ayufan@ayufan.eu>2019-03-29 10:31:57 +0000
commita7cf61355a45a67ef404eeec3e38738f997ef2ec (patch)
treef64b6940e63c2f88a431f24a0cf890614578444e /spec/models
parentfea9400ec8a2a31d582a425226494f5fb9f90495 (diff)
parent7a2325e43c1fe726b4affc544449a763fb52b9e7 (diff)
downloadgitlab-ce-a7cf61355a45a67ef404eeec3e38738f997ef2ec.tar.gz
Merge branch 'sh-fix-gitaly-find-commit-caching' into 'master'
Allow ref name caching CommitService#find_commit Closes #57083 See merge request gitlab-org/gitlab-ce!26248
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/ci/pipeline_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/models/ci/pipeline_spec.rb b/spec/models/ci/pipeline_spec.rb
index 5b8097621e0..225c6812bec 100644
--- a/spec/models/ci/pipeline_spec.rb
+++ b/spec/models/ci/pipeline_spec.rb
@@ -1460,6 +1460,14 @@ describe Ci::Pipeline, :mailer do
end
end
+ context 'with a branch name as the ref' do
+ it 'looks up commit with the full ref name' do
+ expect(pipeline.project).to receive(:commit).with('refs/heads/master').and_call_original
+
+ expect(pipeline).to be_latest
+ end
+ end
+
context 'with not latest sha' do
before do
pipeline.update(