diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2019-02-21 19:54:34 +0300 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2019-02-21 19:54:34 +0300 |
commit | 093f519b2263dec41743c059e8960a2b12289677 (patch) | |
tree | 89034c703c61db84858e89613066af06644c8ccc /spec/views/projects/issues/show.html.haml_spec.rb | |
parent | 885ef319cd8f6b0ad6c12a9b53b64797e8305dcb (diff) | |
parent | a0fbfb5a5343269849cbaaff8b62c0698b254bd6 (diff) |
Merge branch '57784-make-closed-duplicate-and-closed-moved-button-a-link-to-target' into 'master'
Add Link from Closed (moved) Issues to Moved Issue
Closes #57784
See merge request gitlab-org/gitlab-ce!25300
Diffstat (limited to 'spec/views/projects/issues/show.html.haml_spec.rb')
-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 |