2020-03-13 15:44:24 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe Gitlab::Search::FoundWikiPage do
|
2020-03-13 15:44:24 +05:30
|
|
|
let(:project) { create(:project, :public, :repository) }
|
|
|
|
|
|
|
|
describe 'policy' do
|
|
|
|
let(:project) { build(:project, :repository) }
|
|
|
|
let(:found_blob) { Gitlab::Search::FoundBlob.new(project: project) }
|
|
|
|
|
|
|
|
subject { described_class.new(found_blob) }
|
|
|
|
|
|
|
|
it 'works with policy' do
|
|
|
|
expect(Ability.allowed?(project.creator, :read_wiki_page, subject)).to be_truthy
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|