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
Kazuhiko Shiozaki
gitlab-ce
Commits
8a03cb87
Commit
8a03cb87
authored
Nov 16, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Lets add more tests to Milestones services
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
98d6d491
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
52 additions
and
1 deletion
+52
-1
app/finders/milestones_finder.rb
app/finders/milestones_finder.rb
+0
-1
spec/services/milestones/close_service_spec.rb
spec/services/milestones/close_service_spec.rb
+28
-0
spec/services/milestones/create_service_spec.rb
spec/services/milestones/create_service_spec.rb
+24
-0
No files found.
app/finders/milestones_finder.rb
View file @
8a03cb87
...
@@ -10,4 +10,3 @@ class MilestonesFinder
...
@@ -10,4 +10,3 @@ class MilestonesFinder
end
end
end
end
end
end
spec/services/milestones/close_service_spec.rb
0 → 100644
View file @
8a03cb87
require
'spec_helper'
describe
Milestones
::
CloseService
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
let
(
:milestone
)
{
create
(
:milestone
,
title:
"Milestone v1.2"
,
project:
project
)
}
before
do
project
.
team
<<
[
user
,
:master
]
end
describe
:execute
do
before
do
Milestones
::
CloseService
.
new
(
project
,
user
,
{}).
execute
(
milestone
)
end
it
{
expect
(
milestone
).
to
be_valid
}
it
{
expect
(
milestone
).
to
be_closed
}
describe
:event
do
let
(
:event
)
{
Event
.
first
}
it
{
expect
(
event
.
milestone
).
to
be_truthy
}
it
{
expect
(
event
.
target
).
to
eq
(
milestone
)
}
it
{
expect
(
event
.
action_name
).
to
eq
(
'closed'
)
}
end
end
end
spec/services/milestones/create_service_spec.rb
0 → 100644
View file @
8a03cb87
require
'spec_helper'
describe
Milestones
::
CreateService
do
let
(
:project
)
{
create
(
:empty_project
)
}
let
(
:user
)
{
create
(
:user
)
}
describe
:execute
do
context
"valid params"
do
before
do
project
.
team
<<
[
user
,
:master
]
opts
=
{
title:
'v2.1.9'
,
description:
'Patch release to fix security issue'
}
@milestone
=
Milestones
::
CreateService
.
new
(
project
,
user
,
opts
).
execute
end
it
{
expect
(
@milestone
).
to
be_valid
}
it
{
expect
(
@milestone
.
title
).
to
eq
(
'v2.1.9'
)
}
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