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
Jérome Perrin
gitlab-ce
Commits
bd90dfab
Commit
bd90dfab
authored
Aug 16, 2017
by
Jarka Kadlecova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix edit milestone path from group milestones list
parent
441ba5f3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
4 deletions
+29
-4
app/views/shared/milestones/_milestone.html.haml
app/views/shared/milestones/_milestone.html.haml
+1
-1
app/views/shared/milestones/_top.html.haml
app/views/shared/milestones/_top.html.haml
+1
-1
spec/features/groups/milestone_spec.rb
spec/features/groups/milestone_spec.rb
+27
-2
No files found.
app/views/shared/milestones/_milestone.html.haml
View file @
bd90dfab
...
@@ -32,7 +32,7 @@
...
@@ -32,7 +32,7 @@
.col-sm-6.milestone-actions
.col-sm-6.milestone-actions
-
if
can?
(
current_user
,
:admin_milestones
,
@group
)
-
if
can?
(
current_user
,
:admin_milestones
,
@group
)
-
if
milestone
.
is_group_milestone?
-
if
milestone
.
is_group_milestone?
=
link_to
edit_group_milestone_path
(
@group
,
milestone
.
id
),
class:
"btn btn-xs btn-grouped"
do
=
link_to
edit_group_milestone_path
(
@group
,
milestone
),
class:
"btn btn-xs btn-grouped"
do
Edit
Edit
\
\
-
if
milestone
.
closed?
-
if
milestone
.
closed?
...
...
app/views/shared/milestones/_top.html.haml
View file @
bd90dfab
...
@@ -23,7 +23,7 @@
...
@@ -23,7 +23,7 @@
.pull-right
.pull-right
-
if
can?
(
current_user
,
:admin_milestones
,
group
)
-
if
can?
(
current_user
,
:admin_milestones
,
group
)
-
if
milestone
.
is_group_milestone?
-
if
milestone
.
is_group_milestone?
=
link_to
edit_group_milestone_path
(
group
,
milestone
.
iid
),
class:
"btn btn btn-grouped"
do
=
link_to
edit_group_milestone_path
(
group
,
milestone
),
class:
"btn btn btn-grouped"
do
Edit
Edit
-
if
milestone
.
active?
-
if
milestone
.
active?
=
link_to
'Close Milestone'
,
group_milestone_route
(
milestone
,
{
state_event: :close
}),
method: :put
,
class:
"btn btn-grouped btn-close"
=
link_to
'Close Milestone'
,
group_milestone_route
(
milestone
,
{
state_event: :close
}),
method: :put
,
class:
"btn btn-grouped btn-close"
...
...
spec/features/groups/milestone_spec.rb
View file @
bd90dfab
...
@@ -35,12 +35,12 @@ feature 'Group milestones', :js do
...
@@ -35,12 +35,12 @@ feature 'Group milestones', :js do
context
'milestones list'
do
context
'milestones list'
do
let!
(
:other_project
)
{
create
(
:project_empty_repo
,
group:
group
)
}
let!
(
:other_project
)
{
create
(
:project_empty_repo
,
group:
group
)
}
let!
(
:active_group_milestone
)
{
create
(
:milestone
,
group:
group
,
state:
'active'
)
}
let!
(
:active_project_milestone1
)
{
create
(
:milestone
,
project:
project
,
state:
'active'
,
title:
'v1.0'
)
}
let!
(
:active_project_milestone1
)
{
create
(
:milestone
,
project:
project
,
state:
'active'
,
title:
'v1.0'
)
}
let!
(
:active_project_milestone2
)
{
create
(
:milestone
,
project:
other_project
,
state:
'active'
,
title:
'v1.0'
)
}
let!
(
:active_project_milestone2
)
{
create
(
:milestone
,
project:
other_project
,
state:
'active'
,
title:
'v1.0'
)
}
let!
(
:closed_group_milestone
)
{
create
(
:milestone
,
group:
group
,
state:
'closed'
)
}
let!
(
:closed_project_milestone1
)
{
create
(
:milestone
,
project:
project
,
state:
'closed'
,
title:
'v2.0'
)
}
let!
(
:closed_project_milestone1
)
{
create
(
:milestone
,
project:
project
,
state:
'closed'
,
title:
'v2.0'
)
}
let!
(
:closed_project_milestone2
)
{
create
(
:milestone
,
project:
other_project
,
state:
'closed'
,
title:
'v2.0'
)
}
let!
(
:closed_project_milestone2
)
{
create
(
:milestone
,
project:
other_project
,
state:
'closed'
,
title:
'v2.0'
)
}
let!
(
:active_group_milestone
)
{
create
(
:milestone
,
group:
group
,
state:
'active'
)
}
let!
(
:closed_group_milestone
)
{
create
(
:milestone
,
group:
group
,
state:
'closed'
)
}
before
do
before
do
visit
group_milestones_path
(
group
)
visit
group_milestones_path
(
group
)
...
@@ -58,5 +58,30 @@ feature 'Group milestones', :js do
...
@@ -58,5 +58,30 @@ feature 'Group milestones', :js do
expect
(
page
).
to
have_selector
(
"#milestone_
#{
active_group_milestone
.
id
}
"
,
count:
1
)
expect
(
page
).
to
have_selector
(
"#milestone_
#{
active_group_milestone
.
id
}
"
,
count:
1
)
expect
(
page
).
to
have_selector
(
"#milestone_
#{
legacy_milestone
.
milestones
.
first
.
id
}
"
,
count:
1
)
expect
(
page
).
to
have_selector
(
"#milestone_
#{
legacy_milestone
.
milestones
.
first
.
id
}
"
,
count:
1
)
end
end
it
'updates milestone'
do
page
.
within
(
".milestones #milestone_
#{
active_group_milestone
.
id
}
"
)
do
click_link
(
'Edit'
)
end
page
.
within
(
'.milestone-form'
)
do
fill_in
'milestone_title'
,
with:
'new title'
click_button
(
'Update milestone'
)
end
expect
(
find
(
'#content-body h2'
)).
to
have_content
(
'new title'
)
end
it
'shows milestone detail and supports its edit'
do
page
.
within
(
".milestones #milestone_
#{
active_group_milestone
.
id
}
"
)
do
click_link
(
active_group_milestone
.
title
)
end
page
.
within
(
'.detail-page-header'
)
do
click_link
(
'Edit'
)
end
expect
(
page
).
to
have_selector
(
'.milestone-form'
)
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