Commit affcb961 authored by Valery Sizov's avatar Valery Sizov

Explicitly test that guest is able to search through the wiki

parent ef359217
......@@ -69,6 +69,8 @@ module Gitlab
end
def wiki_blobs
return Kaminari.paginate_array([]) unless Ability.allowed?(@current_user, :read_wiki, project)
if project.wiki_enabled? && !project.wiki.empty? && query.present?
project.wiki.search(
query,
......
......@@ -124,8 +124,8 @@ describe Gitlab::ProjectSearchResults, lib: true do
context 'when wiki is internal' do
let(:project) { create(:project, :public, :wiki_private) }
it 'finds wiki blobs for members' do
project.add_reporter(user)
it 'finds wiki blobs for guest' do
project.add_guest(user)
is_expected.not_to be_empty
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment