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
5764dcb7
Commit
5764dcb7
authored
Sep 09, 2020
by
Jarka Košanová
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix parsing epic_id id type param
parent
f6e2ac05
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletion
+19
-1
ee/app/graphql/ee/mutations/issues/update.rb
ee/app/graphql/ee/mutations/issues/update.rb
+6
-0
ee/spec/graphql/mutations/issues/update_spec.rb
ee/spec/graphql/mutations/issues/update_spec.rb
+13
-1
No files found.
ee/app/graphql/ee/mutations/issues/update.rb
View file @
5764dcb7
...
...
@@ -16,6 +16,12 @@ module EE
required:
false
,
description:
'The ID of the parent epic. NULL when removing the association'
end
def
resolve
(
project_path
:,
iid
:,
**
args
)
args
[
:epic_id
]
=
::
GitlabSchema
.
parse_gid
(
args
[
:epic_id
],
expected_type:
::
Epic
).
model_id
if
args
[
:epic_id
]
super
end
end
end
end
...
...
ee/spec/graphql/mutations/issues/update_spec.rb
View file @
5764dcb7
...
...
@@ -15,7 +15,7 @@ RSpec.describe Mutations::Issues::Update do
let_it_be
(
:issue
)
{
create
(
:issue
,
project:
project
)
}
let_it_be
(
:epic
)
{
create
(
:epic
,
group:
group
)
}
let
(
:epic_id
)
{
epic
.
id
}
let
(
:epic_id
)
{
epic
.
to_global_id
.
to_s
}
let
(
:params
)
{
{
project_path:
project
.
full_path
,
iid:
issue
.
iid
,
epic_id:
epic_id
}
}
let
(
:mutated_issue
)
{
subject
[
:issue
]
}
let
(
:mutation
)
{
described_class
.
new
(
object:
nil
,
context:
{
current_user:
user
},
field:
nil
)
}
...
...
@@ -48,14 +48,26 @@ RSpec.describe Mutations::Issues::Update do
context
'when a valid epic is given'
do
it
'updates the epic'
do
expect
{
subject
}.
to
change
{
issue
.
reload
.
epic
}.
from
(
nil
).
to
(
epic
)
end
it
'returns the updated issue'
do
expect
(
mutated_issue
.
epic
).
to
eq
(
epic
)
end
end
context
'when nil epic is given'
do
before
do
issue
.
update!
(
epic:
epic
)
end
let
(
:epic_id
)
{
nil
}
it
'set the epic to nil'
do
expect
{
subject
}.
to
change
{
issue
.
reload
.
epic
}.
from
(
epic
).
to
(
nil
)
end
it
'returns the updated issue'
do
expect
(
mutated_issue
.
epic
).
to
be_nil
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