diff options
author | Douwe Maan <douwe@gitlab.com> | 2019-03-11 14:56:19 +0300 |
---|---|---|
committer | GitLab Release Tools Bot <robert+release-tools@gitlab.com> | 2019-03-13 16:28:17 +0300 |
commit | 9df7dda2d366174b80fd401b696931c638fb1b6c (patch) | |
tree | f33cf303de523875502e4c62007a3f0ea31cca96 /spec | |
parent | 812b64ed86fd1c80658877488a6ea7c4372f2a07 (diff) |
Merge branch 'sh-rugged-commit-tree-entry' into 'master'
Bring back Rugged implementation of commit_tree_entry
See merge request gitlab-org/gitlab-ce!25896
(cherry picked from commit 97357c5bb6594be793c1af332bed8f942f2d72d2)
4ee08fd1 Add back Rugged support for retrieving a commit tree entry
Diffstat (limited to 'spec')
-rw-r--r-- | spec/models/commit_spec.rb | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/spec/models/commit_spec.rb b/spec/models/commit_spec.rb index baad8352185..9d4e18534ae 100644 --- a/spec/models/commit_spec.rb +++ b/spec/models/commit_spec.rb @@ -542,7 +542,7 @@ eos end end - describe '#uri_type' do + shared_examples '#uri_type' do it 'returns the URI type at the given path' do expect(commit.uri_type('files/html')).to be(:tree) expect(commit.uri_type('files/images/logo-black.png')).to be(:raw) @@ -561,6 +561,20 @@ eos end end + describe '#uri_type with Gitaly enabled' do + it_behaves_like "#uri_type" + end + + describe '#uri_type with Rugged enabled', :enable_rugged do + it 'calls out to the Rugged implementation' do + allow_any_instance_of(Rugged::Tree).to receive(:path).with('files/html').and_call_original + + commit.uri_type('files/html') + end + + it_behaves_like '#uri_type' + end + describe '.from_hash' do let(:new_commit) { described_class.from_hash(commit.to_hash, project) } |