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
iv
gitlab-ce
Commits
b607c70e
Commit
b607c70e
authored
Feb 18, 2013
by
Andrew8xx8
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Additional tests added to Milestone
parent
0b4f4fe1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
0 deletions
+33
-0
spec/factories.rb
spec/factories.rb
+6
-0
spec/models/milestone_spec.rb
spec/models/milestone_spec.rb
+27
-0
No files found.
spec/factories.rb
View file @
b607c70e
...
@@ -163,6 +163,12 @@ FactoryGirl.define do
...
@@ -163,6 +163,12 @@ FactoryGirl.define do
factory
:milestone
do
factory
:milestone
do
title
title
project
project
trait
:closed
do
state
:closed
end
factory
:closed_milestone
,
traits:
[
:closed
]
end
end
factory
:system_hook
do
factory
:system_hook
do
...
...
spec/models/milestone_spec.rb
View file @
b607c70e
...
@@ -108,4 +108,31 @@ describe Milestone do
...
@@ -108,4 +108,31 @@ describe Milestone do
describe
:can_be_closed?
do
describe
:can_be_closed?
do
it
{
milestone
.
can_be_closed?
.
should
be_true
}
it
{
milestone
.
can_be_closed?
.
should
be_true
}
end
end
describe
:is_empty?
do
it
'Should return total count of issues and merge requests assigned to milestone'
do
issue
=
create
:closed_issue
,
milestone:
milestone
merge_request
=
create
:merge_request
,
milestone:
milestone
milestone
.
total_items_count
.
should
eq
2
end
end
describe
:can_be_closed?
do
it
'should be true if milestone active and all nestied issues closed'
do
milestone
=
create
:milestone
closed_issue
=
create
:closed_issue
,
milestone:
milestone
milestone
.
can_be_closed?
.
should
be_true
end
it
'should be false if milestone active and not all nestied issues closed'
do
milestone
=
create
:milestone
closed_issue
=
create
:closed_issue
,
milestone:
milestone
issue
=
create
:issue
,
milestone:
milestone
milestone
.
can_be_closed?
.
should
be_false
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