| ... | @@ -19,6 +19,7 @@ describe 'projects/issues/show' do |
... | @@ -19,6 +19,7 @@ describe 'projects/issues/show' do |
|
|
context 'when the issue is closed' do
|
|
context 'when the issue is closed' do
|
|
|
before do
|
|
before do
|
|
|
allow(issue).to receive(:closed?).and_return(true)
|
|
allow(issue).to receive(:closed?).and_return(true)
|
|
|
|
allow(view).to receive(:current_user).and_return(user)
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
context 'when the issue was moved' do
|
|
context 'when the issue was moved' do
|
| ... | @@ -28,6 +29,11 @@ describe 'projects/issues/show' do |
... | @@ -28,6 +29,11 @@ describe 'projects/issues/show' do |
|
|
issue.moved_to = new_issue
|
|
issue.moved_to = new_issue
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
|
context 'when user can see the moved issue' do
|
|
|
|
before 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' do
|
|
|
render
|
|
render
|
|
|
|
|
|
| ... | @@ -41,6 +47,15 @@ describe 'projects/issues/show' do |
... | @@ -41,6 +47,15 @@ describe 'projects/issues/show' do |
|
|
end
|
|
end
|
|
|
end
|
|
end
|
|
|
|
|
|
|
|
|
context 'when user cannot see moved issue' do
|
|
|
|
it 'does not show moved issue link' do
|
|
|
|
render
|
|
|
|
|
|
|
|
expect(rendered).not_to have_selector("a[href=\"#{issue_path(new_issue)}\"]", text: 'moved')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
it 'shows "Closed" if an issue has not been moved' do
|
|
it 'shows "Closed" if an issue has not been moved' do
|
|
|
render
|
|
render
|
|
|
|
|
|
| ... | |
... | |
| ... | | ... | |