Commit 7b84e864 authored by Mark Chao's avatar Mark Chao

Mark FoundBlob to be policy aware

parent 8216e0be
......@@ -7,6 +7,7 @@ module Gitlab
include Presentable
include BlobLanguageFromGitAttributes
include Gitlab::Utils::StrongMemoize
include BlobActiveModel
attr_reader :project, :content_match, :blob_path
......
......@@ -156,4 +156,14 @@ describe Gitlab::Search::FoundBlob do
end
end
end
describe 'policy' do
let(:project) { build(:project, :repository) }
subject { described_class.new(project: project) }
it 'works with policy' do
expect(Ability.allowed?(project.creator, :read_blob, subject)).to be_truthy
end
end
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