BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
1e927d39
Commit
1e927d39
authored
Jan 07, 2016
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update spec
parent
706d7eb0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
9 deletions
+12
-9
Gemfile.lock
Gemfile.lock
+5
-5
receiver_spec.rb
spec/lib/gitlab/email/receiver_spec.rb
+7
-4
No files found.
Gemfile.lock
View file @
1e927d39
...
@@ -443,6 +443,10 @@ GEM
...
@@ -443,6 +443,10 @@ GEM
omniauth (1.2.2)
omniauth (1.2.2)
hashie (>= 1.2, < 4)
hashie (>= 1.2, < 4)
rack (~> 1.0)
rack (~> 1.0)
omniauth-azure-oauth2 (0.0.6)
jwt (~> 1.0)
omniauth (~> 1.0)
omniauth-oauth2 (~> 1.1)
omniauth-bitbucket (0.0.2)
omniauth-bitbucket (0.0.2)
multi_json (~> 1.7)
multi_json (~> 1.7)
omniauth (~> 1.1)
omniauth (~> 1.1)
...
@@ -488,10 +492,6 @@ GEM
...
@@ -488,10 +492,6 @@ GEM
activesupport
activesupport
nokogiri (>= 1.4.4)
nokogiri (>= 1.4.4)
omniauth (~> 1.0)
omniauth (~> 1.0)
omniauth-azure-oauth2 (0.0.6)
jwt (~> 1.0)
omniauth (~> 1.0)
omniauth-oauth2 (~> 1.1)
opennebula (4.14.2)
opennebula (4.14.2)
json
json
nokogiri
nokogiri
...
@@ -920,6 +920,7 @@ DEPENDENCIES
...
@@ -920,6 +920,7 @@ DEPENDENCIES
oauth2 (~> 1.0.0)
oauth2 (~> 1.0.0)
octokit (~> 3.7.0)
octokit (~> 3.7.0)
omniauth (~> 1.2.2)
omniauth (~> 1.2.2)
omniauth-azure-oauth2
omniauth-bitbucket (~> 0.0.2)
omniauth-bitbucket (~> 0.0.2)
omniauth-cas3 (~> 1.1.2)
omniauth-cas3 (~> 1.1.2)
omniauth-facebook (~> 3.0.0)
omniauth-facebook (~> 3.0.0)
...
@@ -931,7 +932,6 @@ DEPENDENCIES
...
@@ -931,7 +932,6 @@ DEPENDENCIES
omniauth-shibboleth (~> 1.2.0)
omniauth-shibboleth (~> 1.2.0)
omniauth-twitter (~> 1.2.0)
omniauth-twitter (~> 1.2.0)
omniauth_crowd
omniauth_crowd
omniauth-azure-oauth2
org-ruby (~> 0.9.12)
org-ruby (~> 0.9.12)
paranoia (~> 2.0)
paranoia (~> 2.0)
pg (~> 0.18.2)
pg (~> 0.18.2)
...
...
spec/lib/gitlab/email/receiver_spec.rb
View file @
1e927d39
...
@@ -42,7 +42,7 @@ describe Gitlab::Email::Receiver, lib: true do
...
@@ -42,7 +42,7 @@ describe Gitlab::Email::Receiver, lib: true do
context
"when the email was auto generated"
do
context
"when the email was auto generated"
do
let!
(
:reply_key
)
{
'636ca428858779856c226bb145ef4fad'
}
let!
(
:reply_key
)
{
'636ca428858779856c226bb145ef4fad'
}
let!
(
:email_raw
)
{
fixture_file
(
"emails/auto_reply.eml"
)
}
let!
(
:email_raw
)
{
fixture_file
(
"emails/auto_reply.eml"
)
}
it
"raises an AutoGeneratedEmailError"
do
it
"raises an AutoGeneratedEmailError"
do
expect
{
receiver
.
execute
}.
to
raise_error
(
Gitlab
::
Email
::
Receiver
::
AutoGeneratedEmailError
)
expect
{
receiver
.
execute
}.
to
raise_error
(
Gitlab
::
Email
::
Receiver
::
AutoGeneratedEmailError
)
end
end
...
@@ -90,7 +90,7 @@ describe Gitlab::Email::Receiver, lib: true do
...
@@ -90,7 +90,7 @@ describe Gitlab::Email::Receiver, lib: true do
context
"when the reply is blank"
do
context
"when the reply is blank"
do
let!
(
:email_raw
)
{
fixture_file
(
"emails/no_content_reply.eml"
)
}
let!
(
:email_raw
)
{
fixture_file
(
"emails/no_content_reply.eml"
)
}
it
"raises an EmptyEmailError"
do
it
"raises an EmptyEmailError"
do
expect
{
receiver
.
execute
}.
to
raise_error
(
Gitlab
::
Email
::
Receiver
::
EmptyEmailError
)
expect
{
receiver
.
execute
}.
to
raise_error
(
Gitlab
::
Email
::
Receiver
::
EmptyEmailError
)
end
end
...
@@ -107,13 +107,16 @@ describe Gitlab::Email::Receiver, lib: true do
...
@@ -107,13 +107,16 @@ describe Gitlab::Email::Receiver, lib: true do
end
end
context
"when everything is fine"
do
context
"when everything is fine"
do
let
(
:markdown
)
{
"![image](uploads/image.png)"
}
before
do
before
do
allow_any_instance_of
(
Gitlab
::
Email
::
AttachmentUploader
).
to
receive
(
:execute
).
and_return
(
allow_any_instance_of
(
Gitlab
::
Email
::
AttachmentUploader
).
to
receive
(
:execute
).
and_return
(
[
[
{
{
url:
"uploads/image.png"
,
url:
"uploads/image.png"
,
is_image:
true
,
is_image:
true
,
alt:
"image"
alt:
"image"
,
markdown:
markdown
}
}
]
]
)
)
...
@@ -132,7 +135,7 @@ describe Gitlab::Email::Receiver, lib: true do
...
@@ -132,7 +135,7 @@ describe Gitlab::Email::Receiver, lib: true do
note
=
noteable
.
notes
.
last
note
=
noteable
.
notes
.
last
expect
(
note
.
note
).
to
include
(
"![image](uploads/image.png)"
)
expect
(
note
.
note
).
to
include
(
markdown
)
end
end
end
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