diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 12:26:25 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-07-20 12:26:25 +0000 |
commit | a09983ae35713f5a2bbb100981116d31ce99826e (patch) | |
tree | 2ee2af7bd104d57086db360a7e6d8c9d5d43667a /spec/helpers/issues_helper_spec.rb | |
parent | 18c5ab32b738c0b6ecb4d0df3994000482f34bd8 (diff) | |
download | gitlab-ce-a09983ae35713f5a2bbb100981116d31ce99826e.tar.gz |
Add latest changes from gitlab-org/gitlab@13-2-stable-ee
Diffstat (limited to 'spec/helpers/issues_helper_spec.rb')
-rw-r--r-- | spec/helpers/issues_helper_spec.rb | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/spec/helpers/issues_helper_spec.rb b/spec/helpers/issues_helper_spec.rb index 3ef6745958c..f2757f0e3ed 100644 --- a/spec/helpers/issues_helper_spec.rb +++ b/spec/helpers/issues_helper_spec.rb @@ -2,7 +2,7 @@ require "spec_helper" -describe IssuesHelper do +RSpec.describe IssuesHelper do let(:project) { create(:project) } let(:issue) { create :issue, project: project } let(:ext_project) { create :redmine_project } @@ -209,4 +209,28 @@ 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 |