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
fcc24a29
Commit
fcc24a29
authored
Mar 03, 2022
by
Valerie Burton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix flaky offset and limit for namespace_spec traversal_scope_examples
parent
968090db
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
8 deletions
+10
-8
spec/support/shared_examples/namespaces/traversal_scope_examples.rb
...rt/shared_examples/namespaces/traversal_scope_examples.rb
+10
-8
No files found.
spec/support/shared_examples/namespaces/traversal_scope_examples.rb
View file @
fcc24a29
...
...
@@ -2,14 +2,14 @@
RSpec
.
shared_examples
'namespace traversal scopes'
do
# Hierarchy 1
let_it_be
(
:group_1
)
{
create
(
:group
)
}
let_it_be
(
:nested_group_1
)
{
create
(
:group
,
parent:
group_1
)
}
let_it_be
(
:deep_nested_group_1
)
{
create
(
:group
,
parent:
nested_group_1
)
}
let_it_be
(
:group_1
)
{
create
(
:group
,
path:
'group-1'
)
}
let_it_be
(
:nested_group_1
)
{
create
(
:group
,
pa
th:
'nested-group-1'
,
pa
rent:
group_1
)
}
let_it_be
(
:deep_nested_group_1
)
{
create
(
:group
,
pa
th:
'deep-nested-group-1'
,
pa
rent:
nested_group_1
)
}
# Hierarchy 2
let_it_be
(
:group_2
)
{
create
(
:group
)
}
let_it_be
(
:nested_group_2
)
{
create
(
:group
,
parent:
group_2
)
}
let_it_be
(
:deep_nested_group_2
)
{
create
(
:group
,
parent:
nested_group_2
)
}
let_it_be
(
:group_2
)
{
create
(
:group
,
path:
'group-2'
)
}
let_it_be
(
:nested_group_2
)
{
create
(
:group
,
pa
th:
'nested-group-2'
,
pa
rent:
group_2
)
}
let_it_be
(
:deep_nested_group_2
)
{
create
(
:group
,
pa
th:
'deep-nested-group-2'
,
pa
rent:
nested_group_2
)
}
# All groups
let_it_be
(
:groups
)
do
...
...
@@ -126,7 +126,7 @@ RSpec.shared_examples 'namespace traversal scopes' do
end
context
'with offset and limit'
do
subject
{
described_class
.
where
(
id:
[
deep_nested_group_1
,
deep_nested_group_2
]).
offset
(
1
).
limit
(
1
).
self_and_ancestors
}
subject
{
described_class
.
where
(
id:
[
deep_nested_group_1
,
deep_nested_group_2
]).
o
rder
(
:path
).
o
ffset
(
1
).
limit
(
1
).
self_and_ancestors
}
it
{
is_expected
.
to
contain_exactly
(
group_2
,
nested_group_2
,
deep_nested_group_2
)
}
end
...
...
@@ -185,6 +185,7 @@ RSpec.shared_examples 'namespace traversal scopes' do
subject
do
described_class
.
where
(
id:
[
deep_nested_group_1
,
deep_nested_group_2
])
.
order
(
:path
)
.
limit
(
1
)
.
offset
(
1
)
.
self_and_ancestor_ids
...
...
@@ -240,7 +241,7 @@ RSpec.shared_examples 'namespace traversal scopes' do
end
context
'with offset and limit'
do
subject
{
described_class
.
where
(
id:
[
group_1
,
group_2
]).
offset
(
1
).
limit
(
1
).
self_and_descendants
}
subject
{
described_class
.
where
(
id:
[
group_1
,
group_2
]).
o
rder
(
:path
).
o
ffset
(
1
).
limit
(
1
).
self_and_descendants
}
it
{
is_expected
.
to
contain_exactly
(
group_2
,
nested_group_2
,
deep_nested_group_2
)
}
end
...
...
@@ -288,6 +289,7 @@ RSpec.shared_examples 'namespace traversal scopes' do
subject
do
described_class
.
where
(
id:
[
group_1
,
group_2
])
.
order
(
:path
)
.
limit
(
1
)
.
offset
(
1
)
.
self_and_descendant_ids
...
...
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