diff options
author | Ahmad Sherif <me@ahmadsherif.com> | 2018-04-11 17:08:23 +0300 |
---|---|---|
committer | Ahmad Sherif <me@ahmadsherif.com> | 2018-04-11 17:08:51 +0300 |
commit | f61121225ebaf9dc425d0e2ad550cf368add8f6e (patch) | |
tree | 7392cae80eab0cb66eb049b1b8f40faee6caee57 /spec/models/project_wiki_spec.rb | |
parent | 37a5632483b67ddcfa4c535cc911319b25f01fb5 (diff) |
Fix finding wiki file when Gitaly is enabled
Fixes gitaly#1126
Diffstat (limited to 'spec/models/project_wiki_spec.rb')
-rw-r--r-- | spec/models/project_wiki_spec.rb | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/spec/models/project_wiki_spec.rb b/spec/models/project_wiki_spec.rb index d87c1ca14f0..374a157bec0 100644 --- a/spec/models/project_wiki_spec.rb +++ b/spec/models/project_wiki_spec.rb @@ -172,11 +172,12 @@ describe ProjectWiki do describe '#find_file' do shared_examples 'finding a wiki file' do + let(:image) { File.open(Rails.root.join('spec', 'fixtures', 'big-image.png')) } + before do - file = File.open(Rails.root.join('spec', 'fixtures', 'dk.png')) subject.wiki # Make sure the wiki repo exists - BareRepoOperations.new(subject.repository.path_to_repo).commit_file(file, 'image.png') + BareRepoOperations.new(subject.repository.path_to_repo).commit_file(image, 'image.png') end it 'returns the latest version of the file if it exists' do @@ -192,6 +193,13 @@ describe ProjectWiki do file = subject.find_file('image.png') expect(file).to be_a Gitlab::Git::WikiFile end + + it 'returns the whole file' do + file = subject.find_file('image.png') + image.rewind + + expect(file.raw_data.b).to eq(image.read.b) + end end context 'when Gitaly wiki_find_file is enabled' do |