Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
7e7b25c8
Commit
7e7b25c8
authored
Apr 27, 2017
by
Sean McGivern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix creating issues by email with Service Desk on
parent
b8988cb6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
6 deletions
+10
-6
changelogs/unreleased-ee/fix-new-issue-mail-when-service-desk-enabled.yml
...eased-ee/fix-new-issue-mail-when-service-desk-enabled.yml
+4
-0
lib/gitlab/email/handler/ee/service_desk_handler.rb
lib/gitlab/email/handler/ee/service_desk_handler.rb
+1
-1
spec/lib/gitlab/email/handler_spec.rb
spec/lib/gitlab/email/handler_spec.rb
+5
-5
No files found.
changelogs/unreleased-ee/fix-new-issue-mail-when-service-desk-enabled.yml
0 → 100644
View file @
7e7b25c8
---
title
:
Fix emailing issues to projects when Service Desk is enabled
merge_request
:
author
:
lib/gitlab/email/handler/ee/service_desk_handler.rb
View file @
7e7b25c8
...
...
@@ -23,7 +23,7 @@ module Gitlab
private
def
service_desk_key
return
unless
mail_key
.
include?
(
"/"
)
return
unless
mail_key
.
include?
(
'/'
)
&&
!
mail_key
.
include?
(
'+'
)
mail_key
end
...
...
spec/lib/gitlab/email/handler_spec.rb
View file @
7e7b25c8
...
...
@@ -16,14 +16,14 @@ describe Gitlab::Email::Handler, lib: true do
allow_any_instance_of
(
License
).
to
receive
(
:add_on?
).
and_call_original
allow_any_instance_of
(
License
).
to
receive
(
:add_on?
).
with
(
'GitLab_ServiceDesk'
).
and_return
(
true
)
expect
(
handler_for
(
'emails/service_desk.eml'
,
's
ervice_desk+s
ome/project'
)).
to
be_instance_of
(
Gitlab
::
Email
::
Handler
::
EE
::
ServiceDeskHandler
)
expect
(
handler_for
(
'emails/service_desk.eml'
,
'some/project'
)).
to
be_instance_of
(
Gitlab
::
Email
::
Handler
::
EE
::
ServiceDeskHandler
)
end
it
'uses
the create issue
handler when Service Desk is disabled'
do
it
'uses
no
handler when Service Desk is disabled'
do
allow_any_instance_of
(
License
).
to
receive
(
:add_on?
).
and_call_original
allow_any_instance_of
(
License
).
to
receive
(
:add_on?
).
with
(
'GitLab_ServiceDesk'
).
and_return
(
false
)
expect
(
handler_for
(
'emails/service_desk.eml'
,
's
ervice_desk+some/project'
)).
to
be_instance_of
(
Gitlab
::
Email
::
Handler
::
CreateIssueHandler
)
expect
(
handler_for
(
'emails/service_desk.eml'
,
's
ome/project'
)).
to
be_nil
end
end
...
...
@@ -34,14 +34,14 @@ describe Gitlab::Email::Handler, lib: true do
allow_any_instance_of
(
License
).
to
receive
(
:add_on?
).
and_call_original
allow_any_instance_of
(
License
).
to
receive
(
:add_on?
).
with
(
'GitLab_ServiceDesk'
).
and_return
(
true
)
expect
(
handler_for
(
'emails/valid_new_issue.eml'
,
'
incoming
+auth_token'
)).
to
be_instance_of
(
Gitlab
::
Email
::
Handler
::
CreateIssueHandler
)
expect
(
handler_for
(
'emails/valid_new_issue.eml'
,
'
some/project
+auth_token'
)).
to
be_instance_of
(
Gitlab
::
Email
::
Handler
::
CreateIssueHandler
)
end
it
'uses the create issue handler when Service Desk is disabled'
do
allow_any_instance_of
(
License
).
to
receive
(
:add_on?
).
and_call_original
allow_any_instance_of
(
License
).
to
receive
(
:add_on?
).
with
(
'GitLab_ServiceDesk'
).
and_return
(
false
)
expect
(
handler_for
(
'emails/valid_new_issue.eml'
,
'
incoming
+auth_token'
)).
to
be_instance_of
(
Gitlab
::
Email
::
Handler
::
CreateIssueHandler
)
expect
(
handler_for
(
'emails/valid_new_issue.eml'
,
'
some/project
+auth_token'
)).
to
be_instance_of
(
Gitlab
::
Email
::
Handler
::
CreateIssueHandler
)
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment