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:
Diffstat (limited to 'spec/models/repository_spec.rb')
-rw-r--r--spec/models/repository_spec.rb18
1 files changed, 17 insertions, 1 deletions
diff --git a/spec/models/repository_spec.rb b/spec/models/repository_spec.rb
index c1f073e26d1..dd54a701282 100644
--- a/spec/models/repository_spec.rb
+++ b/spec/models/repository_spec.rb
@@ -123,7 +123,7 @@ RSpec.describe Repository do
options = { message: 'test tag message\n',
tagger: { name: 'John Smith', email: 'john@gmail.com' } }
- rugged_repo(repository).tags.create(annotated_tag_name, 'a48e4fc218069f68ef2e769dd8dfea3991362175', options)
+ rugged_repo(repository).tags.create(annotated_tag_name, 'a48e4fc218069f68ef2e769dd8dfea3991362175', **options)
double_first = double(committed_date: Time.current - 1.second)
double_last = double(committed_date: Time.current)
@@ -2028,6 +2028,22 @@ RSpec.describe Repository do
end
end
+ describe '#lookup' do
+ before do
+ allow(repository.raw_repository).to receive(:lookup).and_return('interesting_blob')
+ end
+
+ it 'uses the lookup cache' do
+ 2.times.each { repository.lookup('sha1') }
+
+ expect(repository.raw_repository).to have_received(:lookup).once
+ end
+
+ it 'returns the correct value' do
+ expect(repository.lookup('sha1')).to eq('interesting_blob')
+ end
+ end
+
describe '#after_create' do
it 'calls expire_status_cache' do
expect(repository).to receive(:expire_status_cache)