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
fc1226fe
Commit
fc1226fe
authored
Oct 03, 2017
by
Oswaldo Ferreira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove scope issue board params when feature is not available
parent
5e636fa2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
7 deletions
+12
-7
app/services/boards/update_service.rb
app/services/boards/update_service.rb
+6
-1
spec/services/boards/update_service_spec.rb
spec/services/boards/update_service_spec.rb
+6
-6
No files found.
app/services/boards/update_service.rb
View file @
fc1226fe
module
Boards
class
UpdateService
<
Boards
::
BaseService
def
execute
(
board
)
params
.
delete
(
:milestone_id
)
unless
parent
.
feature_available?
(
:scoped_issue_board
)
unless
parent
.
feature_available?
(
:scoped_issue_board
)
params
.
delete
(
:milestone_id
)
params
.
delete
(
:assignee_id
)
params
.
delete
(
:label_ids
)
params
.
delete
(
:weight
)
end
board
.
update
(
params
)
end
...
...
spec/services/boards/update_service_spec.rb
View file @
fc1226fe
...
...
@@ -25,7 +25,7 @@ describe Boards::UpdateService do
expect
(
service
.
execute
(
board
)).
to
eq
false
end
it
'u
dp
ates the milestone with issue board milestones enabled'
do
it
'u
pd
ates the milestone with issue board milestones enabled'
do
stub_licensed_features
(
scoped_issue_board:
true
)
milestone
=
create
(
:milestone
,
project:
project
)
...
...
@@ -35,14 +35,14 @@ describe Boards::UpdateService do
expect
(
board
.
reload
.
milestone
).
to
eq
(
milestone
)
end
it
'
udpates the milestone with the issue board milestones feature
enabled'
do
it
'
filters unpermitted params when scoped issue board is not
enabled'
do
stub_licensed_features
(
scoped_issue_board:
false
)
milestone
=
create
(
:milestone
,
project:
project
)
params
=
{
milestone_id:
double
,
assignee_id:
double
,
label_ids:
double
,
weight:
double
}
service
=
described_class
.
new
(
project
,
double
,
milestone_id:
milestone
.
id
)
service
.
execute
(
board
)
expect
(
board
).
to
receive
(
:update
).
with
({})
expect
(
board
.
reload
.
milestone
).
to
be_nil
service
=
described_class
.
new
(
project
,
double
,
params
)
service
.
execute
(
board
)
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