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
286b8ee6
Commit
286b8ee6
authored
Jun 30, 2017
by
Bob Van Landuyt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Don't update milestones on boards if the feature is not available
parent
3b02f8dc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletion
+23
-1
app/services/boards/update_service.rb
app/services/boards/update_service.rb
+3
-1
spec/services/boards/update_service_spec.rb
spec/services/boards/update_service_spec.rb
+20
-0
No files found.
app/services/boards/update_service.rb
View file @
286b8ee6
module
Boards
class
UpdateService
<
BaseService
def
execute
(
board
)
board
.
update
(
name:
params
[
:name
],
milestone_id:
params
[
:milestone_id
])
params
.
delete
(
:milestone_id
)
unless
project
.
feature_available?
(
:issue_board_milestone
)
board
.
update
(
params
)
end
end
end
spec/services/boards/update_service_spec.rb
View file @
286b8ee6
...
...
@@ -24,5 +24,25 @@ describe Boards::UpdateService, services: true do
expect
(
service
.
execute
(
board
)).
to
eq
false
end
it
'udpates the milestone with issue board milestones enabled'
do
stub_licensed_features
(
issue_board_milestone:
true
)
milestone
=
create
(
:milestone
,
project:
project
)
service
=
described_class
.
new
(
project
,
double
,
milestone_id:
milestone
.
id
)
service
.
execute
(
board
)
expect
(
board
.
reload
.
milestone
).
to
eq
(
milestone
)
end
it
'udpates the milestone with the issue board milestones feature enabled'
do
stub_licensed_features
(
issue_board_milestone:
false
)
milestone
=
create
(
:milestone
,
project:
project
)
service
=
described_class
.
new
(
project
,
double
,
milestone_id:
milestone
.
id
)
service
.
execute
(
board
)
expect
(
board
.
reload
.
milestone
).
to
be_nil
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