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:
authorDouwe Maan <douwe@gitlab.com>2019-03-11 14:56:19 +0300
committerDouwe Maan <douwe@gitlab.com>2019-03-11 14:56:19 +0300
commit97357c5bb6594be793c1af332bed8f942f2d72d2 (patch)
treeb279b33fbc4ff3f2e86b0519fc9b67ab77175630 /spec/models
parent8aacc69b2187cc810c0eadb4cf30fa99619bd908 (diff)
parent4ee08fd1f71caca88243833f08c2b1a59bd0fa9e (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
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/commit_spec.rb16
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) }