diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-15 21:09:26 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-15 21:09:26 +0000 |
commit | 651917dbac09fc4fe9217c08d68420019dff59fb (patch) | |
tree | 6cdda4532d41b7862a33d7f3ab91959c3917d4f0 /spec/helpers/issues_helper_spec.rb | |
parent | da1962d9ac710f95d350d2645c87f5a663123cf2 (diff) | |
download | gitlab-ce-651917dbac09fc4fe9217c08d68420019dff59fb.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/helpers/issues_helper_spec.rb')
-rw-r--r-- | spec/helpers/issues_helper_spec.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/helpers/issues_helper_spec.rb b/spec/helpers/issues_helper_spec.rb index 4ed63704895..f2757f0e3ed 100644 --- a/spec/helpers/issues_helper_spec.rb +++ b/spec/helpers/issues_helper_spec.rb @@ -209,4 +209,28 @@ RSpec.describe IssuesHelper do it_behaves_like 'does not display link' end end + + describe '#show_moved_service_desk_issue_warning?' do + let(:project1) { create(:project, service_desk_enabled: true) } + let(:project2) { create(:project, service_desk_enabled: true) } + let!(:old_issue) { create(:issue, author: User.support_bot, project: project1) } + let!(:new_issue) { create(:issue, author: User.support_bot, project: project2) } + + before do + allow(Gitlab::IncomingEmail).to receive(:enabled?) { true } + allow(Gitlab::IncomingEmail).to receive(:supports_wildcard?) { true } + + old_issue.update(moved_to: new_issue) + end + + it 'is true when moved issue project has service desk disabled' do + project2.update!(service_desk_enabled: false) + + expect(helper.show_moved_service_desk_issue_warning?(new_issue)).to be(true) + end + + it 'is false when moved issue project has service desk enabled' do + expect(helper.show_moved_service_desk_issue_warning?(new_issue)).to be(false) + end + end end |