Commit d97d35d3 authored by Mark Fletcher's avatar Mark Fletcher

Fix bug when reopening milestone from index page

parent 30479246
......@@ -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