2020-01-01 13:55:28 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.describe ReadmeBlob do
|
2020-01-01 13:55:28 +05:30
|
|
|
include FakeBlobHelpers
|
|
|
|
|
|
|
|
describe 'policy' do
|
|
|
|
let(:project) { build(:project, :repository) }
|
2020-03-13 15:44:24 +05:30
|
|
|
|
2020-01-01 13:55:28 +05:30
|
|
|
subject { described_class.new(fake_blob(path: 'README.md'), project.repository) }
|
|
|
|
|
|
|
|
it 'works with policy' do
|
|
|
|
expect(Ability.allowed?(project.creator, :read_blob, subject)).to be_truthy
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|