Commit d9b1585b authored by charlieablett's avatar charlieablett

Apply reviewer feedback

- Add test for reopened moved issue
parent ccf8ff77
......@@ -47,7 +47,7 @@
.issuable-meta
%ul.controls
- if issue.moved? && issue.closed?
- if issue.closed? && issue.moved?
%li.issuable-status
= _('CLOSED (MOVED)')
- elsif issue.closed?
......
......@@ -6,6 +6,7 @@ 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) }
......@@ -32,6 +33,7 @@ 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
......@@ -62,6 +64,7 @@ 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
......@@ -82,6 +85,8 @@ 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
......
......@@ -41,6 +41,14 @@ 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