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
71f46a2c
Commit
71f46a2c
authored
Oct 10, 2017
by
Oswaldo Ferreira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adjust board update service to update assignees
parent
03f74a31
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
5 deletions
+21
-5
app/services/boards/update_service.rb
app/services/boards/update_service.rb
+7
-0
spec/services/boards/update_service_spec.rb
spec/services/boards/update_service_spec.rb
+14
-5
No files found.
app/services/boards/update_service.rb
View file @
71f46a2c
...
...
@@ -8,7 +8,14 @@ module Boards
params
.
delete
(
:weight
)
end
set_assignee
board
.
update
(
params
)
end
def
set_assignee
assignee
=
User
.
find_by
(
id:
params
.
delete
(
:assignee_id
))
params
.
merge!
(
assignee:
assignee
)
end
end
end
spec/services/boards/update_service_spec.rb
View file @
71f46a2c
...
...
@@ -25,24 +25,33 @@ describe Boards::UpdateService do
expect
(
service
.
execute
(
board
)).
to
eq
false
end
it
'updates the
milestone with issue board milestone
s enabled'
do
it
'updates the
configuration params when scoped issue board i
s enabled'
do
stub_licensed_features
(
scoped_issue_board:
true
)
assignee
=
create
(
:user
)
milestone
=
create
(
:milestone
,
project:
project
)
label
=
create
(
:label
,
project:
project
)
service
=
described_class
.
new
(
project
,
double
,
milestone_id:
milestone
.
id
)
service
=
described_class
.
new
(
project
,
double
,
milestone_id:
milestone
.
id
,
assignee_id:
assignee
.
id
,
label_ids:
[
label
.
id
])
service
.
execute
(
board
)
expect
(
board
.
reload
.
milestone
).
to
eq
(
milestone
)
expect
(
board
.
reload
).
to
have_attributes
(
milestone:
milestone
,
assignee:
assignee
,
labels:
[
label
])
end
it
'filters unpermitted params when scoped issue board is not enabled'
do
stub_licensed_features
(
scoped_issue_board:
false
)
params
=
{
milestone_id:
double
,
assignee_id:
double
,
label_ids:
double
,
weight:
double
}
expect
(
board
).
to
receive
(
:update
).
with
({})
service
=
described_class
.
new
(
project
,
double
,
params
)
service
.
execute
(
board
)
expect
(
board
.
reload
).
to
have_attributes
(
milestone:
nil
,
assignee:
nil
,
labels:
[])
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