diff options
author | Shinya Maeda <shinya@gitlab.com> | 2017-11-02 16:12:41 +0900 |
---|---|---|
committer | Shinya Maeda <shinya@gitlab.com> | 2017-11-02 16:12:41 +0900 |
commit | a41fb7b22908547f8b846cd7963586acb02ef753 (patch) | |
tree | 2255085eafc45a55ed9c31f3edc999f097e99636 /spec/features | |
parent | 1427bdcadf5f4026d141a5c4e93db8b1b00fe40a (diff) | |
parent | e54dd249aa7abcdd2c6c888f45399028cb64bb97 (diff) | |
download | gitlab-ce-a41fb7b22908547f8b846cd7963586acb02ef753.tar.gz |
Merge branch 'master' into refactor-clusters
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/projects/wiki/user_views_wiki_page_spec.rb | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/spec/features/projects/wiki/user_views_wiki_page_spec.rb b/spec/features/projects/wiki/user_views_wiki_page_spec.rb index 470391dc66b..89f6901eb01 100644 --- a/spec/features/projects/wiki/user_views_wiki_page_spec.rb +++ b/spec/features/projects/wiki/user_views_wiki_page_spec.rb @@ -81,10 +81,15 @@ describe 'User views a wiki page' do end it 'shows a file stored in a page' do - file = Gollum::File.new(project.wiki) - - allow_any_instance_of(Gollum::Wiki).to receive(:file).with('image.jpg', 'master').and_return(file) - allow_any_instance_of(Gollum::File).to receive(:mime_type).and_return('image/jpeg') + gollum_file_double = double('Gollum::File', + mime_type: 'image/jpeg', + name: 'images/image.jpg', + path: 'images/image.jpg', + raw_data: '') + wiki_file = Gitlab::Git::WikiFile.new(gollum_file_double) + + allow(wiki_file).to receive(:mime_type).and_return('image/jpeg') + allow_any_instance_of(ProjectWiki).to receive(:find_file).with('image.jpg', nil).and_return(wiki_file) expect(page).to have_xpath('//img[@data-src="image.jpg"]') expect(page).to have_link('image', href: "#{project.wiki.wiki_base_path}/image.jpg") |