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
3542279a
Commit
3542279a
authored
Jun 18, 2020
by
Kerri Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clarify test comments and fix typo
parent
fed9026b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
12 deletions
+9
-12
spec/migrations/20200526231421_update_index_approval_rule_name_for_code_owners_rule_type_spec.rb
...ndex_approval_rule_name_for_code_owners_rule_type_spec.rb
+9
-12
No files found.
spec/migrations/20200526231421_update_index_approval_rule_name_for_code_owners_rule_type_spec.rb
View file @
3542279a
...
...
@@ -78,8 +78,8 @@ describe UpdateIndexApprovalRuleNameForCodeOwnersRuleType do
disable_migrations_output
{
migrate!
}
# After running the migration, expect `section == nil` rules to still
# b
e b
locked by the legacy indices, but sectional rules are allowed.
# After running the migration, expect `section == nil` rules to still
be
# blocked by the legacy indices, but sectional rules are allowed.
#
expect
{
create_sectional_approval_rules
}
.
to
change
{
approval_rules
.
count
}.
by
(
2
)
...
...
@@ -115,8 +115,8 @@ describe UpdateIndexApprovalRuleNameForCodeOwnersRuleType do
described_class
::
LEGACY_INDEX_NAME_CODE_OWNERS
)
# Since ApprovalMergeRequestRules are EE-specific, we expect none to
#
be
deleted during the migration.
# Since ApprovalMergeRequestRules are EE-specific, we expect none to
be
# deleted during the migration.
#
expect
{
disable_migrations_output
{
migration
.
down
}
}
.
not_to
change
{
approval_rules
.
count
}
...
...
@@ -144,17 +144,14 @@ describe UpdateIndexApprovalRuleNameForCodeOwnersRuleType do
expect
{
create_two_matching_nil_section_approval_rules
}
.
to
raise_exception
(
ActiveRecord
::
RecordNotUnique
)
# Run the down migration. This will remove the 2 approval rules we create
# above, and call MergeRequests::SyncCodeOwnerApprovalRules to recreate
# new ones.
#
expect
(
MergeRequests
::
SyncCodeOwnerApprovalRules
)
.
to
receive
(
:new
).
with
(
MergeRequest
.
find
(
merge_request
.
id
)).
once
.
and_call_original
# We expect approval_rules.count to be changed by -3 as we're deleting the
# 3 rules created above, and MergeRequests::SyncCodeOwnerApprovalRules
# will not be able to create new one with an empty (or missing)
# CODEOWNERS file.
# Run the down migration. This will remove the 3 approval rules we create
# above, and call MergeRequests::SyncCodeOwnerApprovalRules to recreate
# new ones. However, as there is no CODEOWNERS file in this test
# context, no approval rules will be created, so we can expect
# approval_rules.count to be changed by -3.
#
expect
{
disable_migrations_output
{
migration
.
down
}
}
.
to
change
{
approval_rules
.
count
}.
by
(
-
3
)
...
...
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