Commit 81fe9e9b authored by Rémy Coutable's avatar Rémy Coutable

Merge branch...

Merge branch '49910-reopening-a-closed-milestone-from-the-closed-milestones-page-fails2' into 'master'

Fix bug when reopening milestone from index page

Closes #49910

See merge request gitlab-org/gitlab-ce!26597
parents b0a873aa d97d35d3
......@@ -52,7 +52,7 @@
= link_to 'Close Milestone', project_milestone_path(@project, milestone, milestone: {state_event: :close }), method: :put, remote: true, class: "btn btn-sm btn-close btn-grouped"
- unless milestone.active?
= link_to 'Reopen Milestone', project_milestone_path(@project, milestone, {state_event: :activate }), method: :put, class: "btn btn-grouped btn-reopen"
= link_to 'Reopen Milestone', project_milestone_path(@project, milestone, milestone: {state_event: :activate }), method: :put, class: "btn btn-grouped btn-reopen"
- if @group
- if can?(current_user, :admin_milestone, @group)
- if milestone.closed?
......
---
title: Fix bug when reopening milestone from index page
merge_request:
author:
type: fixed
......@@ -122,4 +122,32 @@ describe 'Milestone' do
expect(page).to have_selector('.popover')
end
end
describe 'reopen closed milestones' do
before do
create(:milestone, :closed, project: project)
end
describe 'group milestones page' do
it 'reopens the milestone' do
visit group_milestones_path(group, { state: 'closed' })
click_link 'Reopen Milestone'
expect(page).not_to have_selector('.status-box-closed')
expect(page).to have_selector('.status-box-open')
end
end
describe 'project milestones page' do
it 'reopens the milestone' do
visit project_milestones_path(project, { state: 'closed' })
click_link 'Reopen Milestone'
expect(page).not_to have_selector('.status-box-closed')
expect(page).to have_selector('.status-box-open')
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment