Commit 1524b205 authored by Sean McGivern's avatar Sean McGivern

Merge branch...

Merge branch '215192-add-spec-for-codeowners_loader-members-to-support-sectional-codeowners' into 'master'

Additional tests for Gitlab::CodeOwners::Loader#members

Closes #215192

See merge request gitlab-org/gitlab!31640
parents 59a0a5a0 1e9fb72e
......@@ -128,12 +128,36 @@ describe Gitlab::CodeOwners::Loader do
end
describe '#members' do
before do
stub_feature_flags(sectional_codeowners: false)
shared_examples_for "returns users for passed path" do
it "returns users mentioned for the passed path do" do
expect(loader.members).to contain_exactly(owner_1, email_owner, documentation_owner)
end
end
it 'returns users mentioned for the passed path' do
expect(loader.members).to contain_exactly(owner_1, email_owner, documentation_owner)
context "when sectional_codeowners is disabled" do
before do
stub_feature_flags(sectional_codeowners: false)
end
it_behaves_like "returns users for passed path"
end
context "when sectional_codeowners is enabled" do
let(:codeowner_content) do
<<~CODEOWNERS
[Documentation]
docs/* @documentation-owner
docs/CODEOWNERS @owner-1 owner2@gitlab.org @owner-3 @documentation-owner
[Testing]
spec/* @test-owner @test-group @test-group/nested-group
CODEOWNERS
end
before do
stub_feature_flags(sectional_codeowners: true)
end
it_behaves_like "returns users for passed path"
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