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
33d94b77
Commit
33d94b77
authored
Apr 07, 2017
by
Sean McGivern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make RuboCop happy
parent
aebffaae
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
18 deletions
+2
-18
spec/lib/gitlab/email/handler_spec.rb
spec/lib/gitlab/email/handler_spec.rb
+2
-18
No files found.
spec/lib/gitlab/email/handler_spec.rb
View file @
33d94b77
...
...
@@ -6,21 +6,6 @@ describe Gitlab::Email::Handler, lib: true do
stub_config_setting
(
host:
'localhost'
)
end
let
(
:email_raw
)
{
fixture_file
(
'emails/service_desk.eml'
)
}
let
(
:email_raw
)
{
fixture_file
(
'emails/valid_new_issue.eml'
)
}
let
(
:email_raw
)
{
fixture_file
(
'emails/valid_reply.eml'
)
}
let
(
:email_raw
)
{
fixture_file
(
'emails/valid_reply.eml'
).
gsub
(
mail_key
,
"
#{
mail_key
}
+unsubscribe"
)
}
let!
(
:project
)
{
create
(
:empty_project
)
}
let!
(
:user
)
do
create
(
:user
,
email:
'jake@adventuretime.ooo'
,
incoming_email_token:
'auth_token'
)
end
describe
'.for'
do
def
handler_for
(
fixture
,
mail_key
)
described_class
.
for
(
fixture_file
(
fixture
),
mail_key
)
...
...
@@ -31,7 +16,6 @@ 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'
,
'service_desk+auth_token'
)).
to
be_instance_of
(
Gitlab
::
Email
::
Handler
::
EE
::
ServiceDeskHandler
)
end
...
...
@@ -39,12 +23,13 @@ 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
(
false
)
expect
(
handler_for
(
'emails/service_desk.eml'
,
'service_desk+auth_token'
)).
to
be_instance_of
(
Gitlab
::
Email
::
Handler
::
CreateIssueHandler
)
end
end
context
'a new issue email'
do
let!
(
:user
)
{
create
(
:user
,
email:
'jake@adventuretime.ooo'
,
incoming_email_token:
'auth_token'
)
}
it
'uses the create issue handler when Service Desk is enabled'
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
)
...
...
@@ -56,7 +41,6 @@ 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
(
false
)
expect
(
handler_for
(
'emails/valid_new_issue.eml'
,
'incoming+auth_token'
)).
to
be_instance_of
(
Gitlab
::
Email
::
Handler
::
CreateIssueHandler
)
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