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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gitlab-ce
Commits
3e52517d
Commit
3e52517d
authored
Jun 30, 2014
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add feature tests for group milestone.
parent
eb5182ac
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
122 additions
and
9 deletions
+122
-9
app/controllers/groups/milestones_controller.rb
app/controllers/groups/milestones_controller.rb
+1
-1
app/models/group_milestone.rb
app/models/group_milestone.rb
+1
-1
app/views/groups/milestones/index.html.haml
app/views/groups/milestones/index.html.haml
+5
-5
app/views/groups/milestones/show.html.haml
app/views/groups/milestones/show.html.haml
+2
-2
features/group.feature
features/group.feature
+19
-0
features/steps/group/group.rb
features/steps/group/group.rb
+94
-0
No files found.
app/controllers/groups/milestones_controller.rb
View file @
3e52517d
...
...
@@ -41,7 +41,7 @@ class Groups::MilestonesController < ApplicationController
end
def
title
params
[
:
id
].
gsub
(
"-"
,
"."
)
params
[
:
title
]
end
def
status
(
state
)
...
...
app/models/group_milestone.rb
View file @
3e52517d
...
...
@@ -10,7 +10,7 @@ class GroupMilestone
end
def
safe_title
@title
.
gsub
(
"."
,
"-"
)
@title
.
parameterize
end
def
milestones
...
...
app/views/groups/milestones/index.html.haml
View file @
3e52517d
...
...
@@ -26,17 +26,17 @@
.pull-right
-
if
can?
(
current_user
,
:manage_group
,
@group
)
-
if
milestone
.
closed?
=
link_to
'Reopen Milestone'
,
group_milestone_path
(
@group
,
milestone
.
safe_title
,
milestone:
{
state_event: :activate
}),
method: :put
,
class:
"btn btn-small btn-grouped"
=
link_to
'Reopen Milestone'
,
group_milestone_path
(
@group
,
milestone
.
safe_title
,
title:
milestone
.
title
,
milestone:
{
state_event: :activate
}),
method: :put
,
class:
"btn btn-small btn-grouped"
-
else
=
link_to
'Close Milestone'
,
group_milestone_path
(
@group
,
milestone
.
safe_title
,
milestone:
{
state_event: :close
}),
method: :put
,
class:
"btn btn-small btn-remove"
=
link_to
'Close Milestone'
,
group_milestone_path
(
@group
,
milestone
.
safe_title
,
title:
milestone
.
title
,
milestone:
{
state_event: :close
}),
method: :put
,
class:
"btn btn-small btn-remove"
%h4
=
link_to_gfm
truncate
(
milestone
.
title
,
length:
100
),
group_milestone_path
(
@group
,
milestone
.
safe_title
)
=
link_to_gfm
truncate
(
milestone
.
title
,
length:
100
),
group_milestone_path
(
@group
,
milestone
.
safe_title
,
title:
milestone
.
title
)
%div
%div
=
link_to
group_milestone_path
(
@group
,
milestone
.
safe_title
,
anchor:
'tab-issues'
)
do
=
link_to
group_milestone_path
(
@group
,
milestone
.
safe_title
,
title:
milestone
.
title
)
do
=
pluralize
milestone
.
issue_count
,
'Issue'
=
link_to
group_milestone_path
(
@group
,
milestone
.
safe_title
,
anchor:
'tab-merge-requests'
)
do
=
link_to
group_milestone_path
(
@group
,
milestone
.
safe_title
,
title:
milestone
.
title
)
do
=
pluralize
milestone
.
merge_requests_count
,
'Merge Request'
%span
.light
#{
milestone
.
percent_complete
}
% complete
...
...
app/views/groups/milestones/show.html.haml
View file @
3e52517d
...
...
@@ -3,9 +3,9 @@
.pull-right
-
if
can?
(
current_user
,
:manage_group
,
@group
)
-
if
@group_milestone
.
active?
=
link_to
'Close Milestone'
,
group_milestone_path
(
@group
,
@group_milestone
.
safe_title
,
milestone:
{
state_event: :close
}),
method: :put
,
class:
"btn btn-small btn-remove"
=
link_to
'Close Milestone'
,
group_milestone_path
(
@group
,
@group_milestone
.
safe_title
,
title:
@group_milestone
.
title
,
milestone:
{
state_event: :close
}),
method: :put
,
class:
"btn btn-small btn-remove"
-
else
=
link_to
'Reopen Milestone'
,
group_milestone_path
(
@group
,
@group_milestone
.
safe_title
,
milestone:
{
state_event: :activate
}),
method: :put
,
class:
"btn btn-small btn-grouped"
=
link_to
'Reopen Milestone'
,
group_milestone_path
(
@group
,
@group_milestone
.
safe_title
,
title:
@group_milestone
.
title
,
milestone:
{
state_event: :activate
}),
method: :put
,
class:
"btn btn-small btn-grouped"
-
if
(
@group_milestone
.
total_items_count
==
@group_milestone
.
closed_items_count
)
&&
@group_milestone
.
active?
.alert.alert-success
...
...
features/group.feature
View file @
3e52517d
...
...
@@ -120,3 +120,22 @@ Feature: Groups
When
I search for 'Mary' member
Then
I should see user
"Mary Jane"
in team list
Then
I should not see user
"John Doe"
in team list
Scenario
:
I
should see group
"Owned"
milestone index page with no milestones
When
I visit group
"Owned"
page
And
I click on group milestones
Then
I should see group milestones index page has no milestones
Scenario
:
I
should see group
"Owned"
milestone index page with milestones
Given
Group has projects with milestones
When
I visit group
"Owned"
page
And
I click on group milestones
Then
I should see group milestones index page with milestones
Scenario
:
I
should see group
"Owned"
milestone show page
Given
Group has projects with milestones
When
I visit group
"Owned"
page
And
I click on group milestones
And
I click on one group milestone
Then
I should see group milestone with all issues and MRs assigned to that milestone
features/steps/group/group.rb
View file @
3e52517d
...
...
@@ -164,6 +164,36 @@ class Groups < Spinach::FeatureSteps
end
end
step
'I click on group milestones'
do
click_link
'Milestones'
end
step
'I should see group milestones index page has no milestones'
do
page
.
should
have_content
(
'No milestones to show'
)
end
step
'Group has projects with milestones'
do
group_milestone
end
step
'I should see group milestones index page with milestones'
do
page
.
should
have_content
(
'Version 7.2'
)
page
.
should
have_content
(
'GL-113'
)
page
.
should
have_link
(
'2 Issues'
,
href:
group_milestone_path
(
"owned"
,
"version-7-2"
,
title:
"Version 7.2"
))
page
.
should
have_link
(
'3 Merge Requests'
,
href:
group_milestone_path
(
"owned"
,
"gl-113"
,
title:
"GL-113"
))
end
step
'I click on one group milestone'
do
click_link
'GL-113'
end
step
'I should see group milestone with all issues and MRs assigned to that milestone'
do
page
.
should
have_content
(
'Milestone GL-113'
)
page
.
should
have_content
(
'Progress: 0 closed – 4 open'
)
page
.
should
have_link
(
@issue1
.
title
,
href:
project_issue_path
(
@project1
,
@issue1
))
page
.
should
have_link
(
@mr3
.
title
,
href:
project_merge_request_path
(
@project3
,
@mr3
))
end
protected
def
assigned_to_me
key
...
...
@@ -173,4 +203,68 @@ class Groups < Spinach::FeatureSteps
def
project
Group
.
find_by
(
name:
"Owned"
).
projects
.
first
end
def
group_milestone
group
=
Group
.
find_by
(
name:
"Owned"
)
@project1
=
create
:project
,
group:
group
project2
=
create
:project
,
path:
'gitlab-ci'
,
group:
group
@project3
=
create
:project
,
path:
'cookbook-gitlab'
,
group:
group
milestone1_project1
=
create
:milestone
,
title:
"Version 7.2"
,
project:
@project1
milestone1_project2
=
create
:milestone
,
title:
"Version 7.2"
,
project:
project2
milestone1_project3
=
create
:milestone
,
title:
"Version 7.2"
,
project:
@project3
milestone2_project1
=
create
:milestone
,
title:
"GL-113"
,
project:
@project1
milestone2_project2
=
create
:milestone
,
title:
"GL-113"
,
project:
project2
milestone2_project3
=
create
:milestone
,
title:
"GL-113"
,
project:
@project3
@issue1
=
create
:issue
,
project:
@project1
,
assignee:
current_user
,
author:
current_user
,
milestone:
milestone2_project1
issue2
=
create
:issue
,
project:
project2
,
assignee:
current_user
,
author:
current_user
,
milestone:
milestone1_project2
issue3
=
create
:issue
,
project:
@project3
,
assignee:
current_user
,
author:
current_user
,
milestone:
milestone1_project1
mr1
=
create
:merge_request
,
source_project:
@project1
,
target_project:
@project1
,
assignee:
current_user
,
author:
current_user
,
milestone:
milestone2_project1
mr2
=
create
:merge_request
,
source_project:
project2
,
target_project:
project2
,
assignee:
current_user
,
author:
current_user
,
milestone:
milestone2_project2
@mr3
=
create
:merge_request
,
source_project:
@project3
,
target_project:
@project3
,
assignee:
current_user
,
author:
current_user
,
milestone:
milestone2_project3
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