Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
419b9a45
Commit
419b9a45
authored
May 21, 2020
by
Kerri Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add additional sectional-codeowners test
parent
a81bba38
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
7 deletions
+26
-7
ee/spec/services/ee/merge_requests/refresh_service_spec.rb
ee/spec/services/ee/merge_requests/refresh_service_spec.rb
+26
-7
No files found.
ee/spec/services/ee/merge_requests/refresh_service_spec.rb
View file @
419b9a45
...
@@ -95,19 +95,38 @@ describe MergeRequests::RefreshService do
...
@@ -95,19 +95,38 @@ describe MergeRequests::RefreshService do
subject
subject
end
end
context
'when :sectional_codeowners is disabled'
do
context
"creating approval_rules"
do
before
do
shared_examples_for
'creates an approval rule based on current diff'
do
stub_feature_flags
(
sectional_codeowners:
false
)
it
"creates expected approval rules"
do
expect
(
another_merge_request
.
approval_rules
.
size
).
to
eq
(
approval_rules_size
)
expect
(
another_merge_request
.
approval_rules
.
first
.
rule_type
).
to
eq
(
'code_owner'
)
end
end
end
it
'creates an approval rule based on current diff'
do
before
do
file
=
File
.
read
(
Rails
.
root
.
join
(
'ee'
,
'spec'
,
'fixtures'
,
'codeowners_example'
))
project
.
repository
.
create_file
(
owner
,
'CODEOWNERS'
,
file
,
{
branch_name:
'test'
,
message:
'codeowners'
})
project
.
repository
.
create_file
(
owner
,
'CODEOWNERS'
,
file
,
{
branch_name:
'test'
,
message:
'codeowners'
})
subject
subject
end
context
'with a non-sectional codeowners file'
do
let_it_be
(
:file
)
do
File
.
read
(
Rails
.
root
.
join
(
'ee'
,
'spec'
,
'fixtures'
,
'codeowners_example'
))
end
expect
(
another_merge_request
.
approval_rules
.
size
).
to
eq
(
3
)
it_behaves_like
'creates an approval rule based on current diff'
do
expect
(
another_merge_request
.
approval_rules
.
first
.
rule_type
).
to
eq
(
'code_owner'
)
let
(
:approval_rules_size
)
{
3
}
end
end
context
'with a sectional codeowners file'
do
let_it_be
(
:file
)
do
File
.
read
(
Rails
.
root
.
join
(
'ee'
,
'spec'
,
'fixtures'
,
'sectional_codeowners_example'
))
end
it_behaves_like
'creates an approval rule based on current diff'
do
let
(
:approval_rules_size
)
{
4
}
end
end
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment