diff options
author | Andrew Fontaine <afontaine@gitlab.com> | 2019-02-15 22:05:23 +0300 |
---|---|---|
committer | Andrew Fontaine <afontaine@gitlab.com> | 2019-02-21 17:34:00 +0300 |
commit | 37b9173bd55ad9642df1e63075a078c282b31b28 (patch) | |
tree | 32f8e4a4ed7711922078a5ece25049574a7855fb /spec | |
parent | c8bf9f78f3e481cb7e74384fa45b46b864fa523a (diff) |
Make "moved" Link to Moved Issue
The text "moved" now links to the issue the closed issue was moved to.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/views/projects/issues/show.html.haml_spec.rb | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/spec/views/projects/issues/show.html.haml_spec.rb b/spec/views/projects/issues/show.html.haml_spec.rb index ff88efd0e31..1d9c6d36ad7 100644 --- a/spec/views/projects/issues/show.html.haml_spec.rb +++ b/spec/views/projects/issues/show.html.haml_spec.rb @@ -21,12 +21,24 @@ describe 'projects/issues/show' do allow(issue).to receive(:closed?).and_return(true) end - it 'shows "Closed (moved)" if an issue has been moved' do - allow(issue).to receive(:moved?).and_return(true) + context 'when the issue was moved' do + let(:new_issue) { create(:issue, project: project, author: user) } - render + before do + issue.moved_to = new_issue + end + + it 'shows "Closed (moved)" if an issue has been moved' do + render + + expect(rendered).to have_selector('.status-box-issue-closed:not(.hidden)', text: 'Closed (moved)') + end + + it 'links "moved" to the new issue the original issue was moved to' do + render - expect(rendered).to have_selector('.status-box-issue-closed:not(.hidden)', text: 'Closed (moved)') + expect(rendered).to have_selector("a[href=\"#{issue_path(new_issue)}\"]", text: 'moved') + end end it 'shows "Closed" if an issue has not been moved' do |