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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
bd6f1ceb
Commit
bd6f1ceb
authored
Jul 18, 2018
by
Mark Chao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add missing spec
parent
b211f7c2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
spec/services/milestones/update_service_spec.rb
spec/services/milestones/update_service_spec.rb
+41
-0
No files found.
spec/services/milestones/update_service_spec.rb
0 → 100644
View file @
bd6f1ceb
# frozen_string_literal: true
require
'spec_helper'
describe
Milestones
::
UpdateService
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:user
)
{
build
(
:user
)
}
let
(
:milestone
)
{
create
(
:milestone
,
project:
project
)
}
describe
'#execute'
do
context
"valid params"
do
let
(
:inner_service
)
{
double
(
:service
)
}
before
do
project
.
add_maintainer
(
user
)
end
subject
{
described_class
.
new
(
project
,
user
,
{
title:
'new_title'
}).
execute
(
milestone
)
}
it
{
expect
(
subject
).
to
be_valid
}
it
{
expect
(
subject
.
title
).
to
eq
(
'new_title'
)
}
context
'state_event is activate'
do
it
'calls ReopenService'
do
expect
(
Milestones
::
ReopenService
).
to
receive
(
:new
).
with
(
project
,
user
,
{}).
and_return
(
inner_service
)
expect
(
inner_service
).
to
receive
(
:execute
).
with
(
milestone
)
described_class
.
new
(
project
,
user
,
{
state_event:
'activate'
}).
execute
(
milestone
)
end
end
context
'state_event is close'
do
it
'calls ReopenService'
do
expect
(
Milestones
::
CloseService
).
to
receive
(
:new
).
with
(
project
,
user
,
{}).
and_return
(
inner_service
)
expect
(
inner_service
).
to
receive
(
:execute
).
with
(
milestone
)
described_class
.
new
(
project
,
user
,
{
state_event:
'close'
}).
execute
(
milestone
)
end
end
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