Commit 2f17b5b8 authored by Shinya Maeda's avatar Shinya Maeda

Merge branch 'kerrizor/add-additional-codeowner-parsing-tests' into 'master'

Add additional specs for Section support

See merge request gitlab-org/gitlab!36897
parents 1810dfb3 122cdb5b
......@@ -53,3 +53,11 @@ model/db @gl-database
[dOcUmEnTaTiOn]
README.md @gl-docs
[Two Words]
README.md @gl-database
model/db @gl-database
[Double::Colon]
README.md @gl-database
model/db @gl-database
......@@ -53,3 +53,11 @@ model/db @gl-database
[Documentation]
README.md @gl-docs
[Two Words]
README.md @gl-database
model/db @gl-database
[Double::Colon]
README.md @gl-database
model/db @gl-database
......@@ -63,8 +63,14 @@ RSpec.describe Gitlab::CodeOwners::File do
it "is a hash sorted by sections without duplicates" do
data = file.parsed_data
expect(data.keys.length).to eq(3)
expect(data.keys).to contain_exactly("codeowners", "Documentation", "Database")
expect(data.keys.length).to eq(5)
expect(data.keys).to contain_exactly(
"codeowners",
"Documentation",
"Database",
"Two Words",
"Double::Colon"
)
end
codeowners_section_paths = [
......@@ -84,6 +90,8 @@ RSpec.describe Gitlab::CodeOwners::File do
"codeowners" | codeowners_section_paths | codeowners_section_owners
"Documentation" | ["/**/README.md", "/**/ee/docs", "/**/docs"] | ["@gl-docs"]
"Database" | ["/**/README.md", "/**/model/db"] | ["@gl-database"]
"Two Words" | ["/**/README.md", "/**/model/db"] | ["@gl-database"]
"Double::Colon" | ["/**/README.md", "/**/model/db"] | ["@gl-database"]
end
with_them do
......
......@@ -125,7 +125,7 @@ RSpec.describe MergeRequests::RefreshService do
end
it_behaves_like 'creates an approval rule based on current diff' do
let(:approval_rules_size) { 5 }
let(:approval_rules_size) { 7 }
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