Commit d5ec0707 authored by Douglas Barbosa Alexandre's avatar Douglas Barbosa Alexandre

Merge branch '219331-cablett-issues-list-reopened-issue' into 'master'

Correct status for moved and reopened issues on issue list

Closes #219331

See merge request gitlab-org/gitlab!33238
parents 4e760499 d9b1585b
......@@ -47,7 +47,7 @@
.issuable-meta
%ul.controls
- if issue.moved?
- if issue.closed? && issue.moved?
%li.issuable-status
= _('CLOSED (MOVED)')
- elsif issue.closed?
......
---
title: Issue list page shows correct status for moved re-opened issues
merge_request: 33238
author:
type: fixed
......@@ -6,6 +6,7 @@ RSpec.describe "User views issues" do
let!(:closed_issue) { create(:closed_issue, project: project) }
let!(:open_issue1) { create(:issue, project: project) }
let!(:open_issue2) { create(:issue, project: project) }
let!(:moved_open_issue) { create(:issue, project: project, moved_to: create(:issue)) }
let_it_be(:user) { create(:user) }
......@@ -36,6 +37,7 @@ RSpec.describe "User views issues" do
.and have_content(open_issue1.title)
.and have_content(open_issue2.title)
.and have_no_content(closed_issue.title)
.and have_content(moved_open_issue.title)
.and have_no_selector(".js-new-board-list")
end
......@@ -66,6 +68,7 @@ RSpec.describe "User views issues" do
.and have_content(closed_issue.title)
.and have_no_content(open_issue1.title)
.and have_no_content(open_issue2.title)
.and have_no_content(moved_open_issue.title)
.and have_no_selector(".js-new-board-list")
end
......@@ -86,6 +89,8 @@ RSpec.describe "User views issues" do
.and have_content(closed_issue.title)
.and have_content(open_issue1.title)
.and have_content(open_issue2.title)
.and have_content(moved_open_issue.title)
.and have_no_content('CLOSED (MOVED)')
.and have_no_selector(".js-new-board-list")
end
......
......@@ -23,7 +23,7 @@ RSpec.describe 'projects/issues/show' do
project.add_developer(user)
end
it 'shows "Closed (moved)" if an issue has been moved' do
it 'shows "Closed (moved)" if an issue has been moved and closed' do
render
expect(rendered).to have_selector('.status-box-issue-closed:not(.hidden)', text: 'Closed (moved)')
......@@ -41,6 +41,14 @@ RSpec.describe 'projects/issues/show' do
expect(rendered).to have_selector("a[href=\"#{issue_path(new_issue)}\"]", text: 'moved')
end
it 'does not show "closed (moved)" if an issue has been moved and reopened (not closed)' do
allow(issue).to receive(:closed?).and_return(false)
render
expect(rendered).not_to have_selector('.status-box-issue-closed:not(.hidden)', text: 'Closed (moved)')
end
end
context 'when user cannot see moved issue' do
......
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