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
5ea16e44
Commit
5ea16e44
authored
Aug 21, 2020
by
Alex Kalderimis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test service idempotency
parent
029d6152
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
spec/services/issue_rebalancing_service_spec.rb
spec/services/issue_rebalancing_service_spec.rb
+11
-3
No files found.
spec/services/issue_rebalancing_service_spec.rb
View file @
5ea16e44
...
@@ -34,7 +34,6 @@ RSpec.describe IssueRebalancingService do
...
@@ -34,7 +34,6 @@ RSpec.describe IssueRebalancingService do
it
'rebalances a set of issues with clumps at the end and start'
do
it
'rebalances a set of issues with clumps at the end and start'
do
all_issues
=
start_clump
+
unclumped
+
end_clump
.
reverse
all_issues
=
start_clump
+
unclumped
+
end_clump
.
reverse
service
=
described_class
.
new
(
project
.
issues
.
first
)
service
=
described_class
.
new
(
project
.
issues
.
first
)
expect
{
service
.
execute
}.
not_to
change
{
issues_in_position_order
.
map
(
&
:id
)
}
expect
{
service
.
execute
}.
not_to
change
{
issues_in_position_order
.
map
(
&
:id
)
}
...
@@ -46,7 +45,16 @@ RSpec.describe IssueRebalancingService do
...
@@ -46,7 +45,16 @@ RSpec.describe IssueRebalancingService do
end
end
expect
(
gaps
).
to
all
(
be
>
RelativePositioning
::
MIN_GAP
)
expect
(
gaps
).
to
all
(
be
>
RelativePositioning
::
MIN_GAP
)
expect
(
all_issues
.
first
.
relative_position
).
to
be
>
RelativePositioning
::
MIN_POSITION
expect
(
all_issues
.
first
.
relative_position
).
to
be
>
(
RelativePositioning
::
MIN_POSITION
*
0.9999
)
expect
(
all_issues
.
last
.
relative_position
).
to
be
<
RelativePositioning
::
MAX_POSITION
expect
(
all_issues
.
last
.
relative_position
).
to
be
<
(
RelativePositioning
::
MAX_POSITION
*
0.9999
)
end
it
'is idempotent'
do
service
=
described_class
.
new
(
project
.
issues
.
first
)
expect
do
service
.
execute
service
.
execute
end
.
not_to
change
{
issues_in_position_order
.
map
(
&
:id
)
}
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