Commit 525fb86b authored by Rémy Coutable's avatar Rémy Coutable

Add missing trait and remove spec that doesn't make sense in this branch

The `repository_access_level` attribute doesn't exist in the 8-12-stable
branch so repository access cannot be restricted using this feature.

Fortunately we use `can?(user, :download_code, ref_project)` in
lib/banzai/reference_parser/commit_parser.rb and
lib/banzai/reference_parser/commit_range_parser.rb and this permission
already exists in 8-12-stable (it only depends on the project
`visibility_access`).
Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent 6e798d2a
......@@ -3,5 +3,11 @@ FactoryGirl.define do
access_level { GroupMember::OWNER }
group
user
trait(:guest) { access_level GroupMember::GUEST }
trait(:reporter) { access_level GroupMember::REPORTER }
trait(:developer) { access_level GroupMember::DEVELOPER }
trait(:master) { access_level GroupMember::MASTER }
trait(:owner) { access_level GroupMember::OWNER }
end
end
......@@ -8,14 +8,6 @@ describe Banzai::ReferenceParser::CommitParser, lib: true do
subject { described_class.new(project, user) }
let(:link) { empty_html_link }
describe '#nodes_visible_to_user' do
context 'when the link has a data-issue attribute' do
before { link['data-commit'] = 123 }
it_behaves_like "referenced feature visibility", "repository"
end
end
describe '#referenced_by' do
context 'when the link has a data-project attribute' do
before do
......
......@@ -8,14 +8,6 @@ describe Banzai::ReferenceParser::CommitRangeParser, lib: true do
subject { described_class.new(project, user) }
let(:link) { empty_html_link }
describe '#nodes_visible_to_user' do
context 'when the link has a data-issue attribute' do
before { link['data-commit-range'] = '123..456' }
it_behaves_like "referenced feature visibility", "repository"
end
end
describe '#referenced_by' do
context 'when the link has a data-project attribute' do
before do
......
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