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
81e84425
Commit
81e84425
authored
Jan 19, 2021
by
Nicolas Dular
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use aggregate_failures for protected branch spec
parent
1f43bfa3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
ee/spec/services/ee/protected_branches/create_service_spec.rb
...pec/services/ee/protected_branches/create_service_spec.rb
+5
-5
No files found.
ee/spec/services/ee/protected_branches/create_service_spec.rb
View file @
81e84425
...
...
@@ -33,7 +33,7 @@ RSpec.describe ProtectedBranches::CreateService do
params
[
:code_owner_approval_required
]
=
true
end
it
"ignores incoming params and sets code_owner_approval_required to false"
do
it
"ignores incoming params and sets code_owner_approval_required to false"
,
:aggregate_failures
do
expect
{
service
.
execute
}.
to
change
(
ProtectedBranch
,
:count
).
by
(
1
)
expect
(
ProtectedBranch
.
last
.
code_owner_approval_required
).
to
be_falsy
end
...
...
@@ -48,7 +48,7 @@ RSpec.describe ProtectedBranches::CreateService do
context
"when code_owner_approval_required param is true"
do
let
(
:code_owner_approval_required
)
{
true
}
it
"sets code_owner_approval_required to true"
do
it
"sets code_owner_approval_required to true"
,
:aggregate_failures
do
expect
{
service
.
execute
}.
to
change
(
ProtectedBranch
,
:count
).
by
(
1
)
expect
(
ProtectedBranch
.
last
.
code_owner_approval_required
).
to
be_truthy
end
...
...
@@ -63,7 +63,7 @@ RSpec.describe ProtectedBranches::CreateService do
context
"when code_owner_approval_required param is false"
do
let
(
:code_owner_approval_required
)
{
false
}
it
"sets code_owner_approval_required to false"
do
it
"sets code_owner_approval_required to false"
,
:aggregate_failures
do
expect
{
service
.
execute
}.
to
change
(
ProtectedBranch
,
:count
).
by
(
1
)
expect
(
ProtectedBranch
.
last
.
code_owner_approval_required
).
to
be_falsy
end
...
...
@@ -82,7 +82,7 @@ RSpec.describe ProtectedBranches::CreateService do
)
end
it
"calls MergeRequest::SyncCodeOwnerApprovalRules to update open MRs"
do
it
"calls MergeRequest::SyncCodeOwnerApprovalRules to update open MRs"
,
:aggregate_failures
do
expect
(
::
MergeRequests
::
SyncCodeOwnerApprovalRules
).
to
receive
(
:new
).
with
(
merge_request
).
and_call_original
expect
{
service
.
execute
}.
to
change
(
ProtectedBranch
,
:count
).
by
(
1
)
end
...
...
@@ -93,7 +93,7 @@ RSpec.describe ProtectedBranches::CreateService do
params
[
:name
]
=
wildcard
end
it
"calls MergeRequest::SyncCodeOwnerApprovalRules to update open MRs for
#{
wildcard
}
"
do
it
"calls MergeRequest::SyncCodeOwnerApprovalRules to update open MRs for
#{
wildcard
}
"
,
:aggregate_failures
do
expect
(
::
MergeRequests
::
SyncCodeOwnerApprovalRules
).
to
receive
(
:new
).
with
(
merge_request
).
and_call_original
expect
{
service
.
execute
}.
to
change
(
ProtectedBranch
,
:count
).
by
(
1
)
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