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
368e9f58
Commit
368e9f58
authored
Aug 07, 2020
by
Mario de la Ossa
Committed by
Ash McKenzie
Aug 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Iteration - do not default include ancestors when IID provided
parent
f3ea409a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
ee/app/graphql/resolvers/iterations_resolver.rb
ee/app/graphql/resolvers/iterations_resolver.rb
+1
-1
ee/spec/graphql/resolvers/iterations_resolver_spec.rb
ee/spec/graphql/resolvers/iterations_resolver_spec.rb
+9
-1
No files found.
ee/app/graphql/resolvers/iterations_resolver.rb
View file @
368e9f58
...
...
@@ -28,7 +28,7 @@ module Resolvers
authorize!
args
[
:include_ancestors
]
=
true
if
args
[
:include_ancestors
].
nil?
args
[
:include_ancestors
]
=
true
if
args
[
:include_ancestors
].
nil?
&&
args
[
:iid
].
nil?
iterations
=
IterationsFinder
.
new
(
context
[
:current_user
],
iterations_finder_params
(
args
)).
execute
...
...
ee/spec/graphql/resolvers/iterations_resolver_spec.rb
View file @
368e9f58
...
...
@@ -45,7 +45,7 @@ RSpec.describe Resolvers::IterationsResolver do
search
=
'wow'
id
=
1
iid
=
2
params
=
{
id:
id
,
iid:
iid
,
group_ids:
Group
.
where
(
id:
group
.
id
).
select
(
:id
)
,
state:
'closed'
,
start_date:
start_date
,
end_date:
end_date
,
search_title:
search
}
params
=
{
id:
id
,
iid:
iid
,
group_ids:
group
.
id
,
state:
'closed'
,
start_date:
start_date
,
end_date:
end_date
,
search_title:
search
}
expect
(
IterationsFinder
).
to
receive
(
:new
).
with
(
current_user
,
params
).
and_call_original
...
...
@@ -64,6 +64,14 @@ RSpec.describe Resolvers::IterationsResolver do
resolve_group_iterations
({},
subgroup
)
end
it
'does not default to include_ancestors if IID is supplied'
do
params
=
{
id:
nil
,
iid:
1
,
group_ids:
subgroup
.
id
,
state:
'all'
,
start_date:
nil
,
end_date:
nil
,
search_title:
nil
}
expect
(
IterationsFinder
).
to
receive
(
:new
).
with
(
current_user
,
params
).
and_call_original
resolve_group_iterations
({
iid:
1
,
include_ancestors:
false
},
subgroup
)
end
it
'accepts include_ancestors false'
do
params
=
{
id:
nil
,
iid:
nil
,
group_ids:
subgroup
.
id
,
state:
'all'
,
start_date:
nil
,
end_date:
nil
,
search_title:
nil
}
...
...
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