Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
OHR Support
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
97
Issues
97
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
OHR Support
Commits
3d164f1d
Commit
3d164f1d
authored
Jun 17, 2011
by
Eric Davis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[#480] Fix replying to IssueJournals through email
parent
0daa081d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
84 additions
and
1 deletion
+84
-1
mail_handler.rb
app/models/mail_handler.rb
+1
-1
ticket_reply_by_message_id.eml
test/fixtures/mail_handler/ticket_reply_by_message_id.eml
+74
-0
mail_handler_test.rb
test/unit/mail_handler_test.rb
+9
-0
No files found.
app/models/mail_handler.rb
View file @
3d164f1d
...
...
@@ -165,7 +165,7 @@ class MailHandler < ActionMailer::Base
end
# Reply will be added to the issue
def
receive_journal_reply
(
journal_id
)
def
receive_
issue_
journal_reply
(
journal_id
)
journal
=
Journal
.
find_by_id
(
journal_id
)
if
journal
and
journal
.
journaled
.
is_a?
Issue
receive_issue_reply
(
journal
.
journaled_id
)
...
...
test/fixtures/mail_handler/ticket_reply_by_message_id.eml
0 → 100644
View file @
3d164f1d
Return-Path: <jsmith@somenet.foo>
Received: from osiris ([127.0.0.1])
by OSIRIS
with hMailServer ; Sat, 21 Jun 2008 18:41:39 +0200
Message-ID: <006a01c8d3bd$ad9baec0$0a00a8c0@osiris>
In-Reply-To: <chiliproject.issue_journal-3.20110617112550@example.net>
From: "John Smith" <jsmith@somenet.foo>
To: <redmine@somenet.foo>
References: <485d0ad366c88_d7014663a025f@osiris.tmail>
Subject: Re: Add ingredients categories
Date: Sat, 21 Jun 2008 18:41:39 +0200
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_0067_01C8D3CE.711F9CC0"
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2900.2869
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869
This is a multi-part message in MIME format.
------=_NextPart_000_0067_01C8D3CE.711F9CC0
Content-Type: text/plain;
charset="utf-8"
Content-Transfer-Encoding: quoted-printable
This is reply
------=_NextPart_000_0067_01C8D3CE.711F9CC0
Content-Type: text/html;
charset="utf-8"
Content-Transfer-Encoding: quoted-printable
=EF=BB=BF<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dutf-8">
<STYLE>BODY {
FONT-SIZE: 0.8em; COLOR: #484848; FONT-FAMILY: Verdana, sans-serif
}
BODY H1 {
FONT-SIZE: 1.2em; MARGIN: 0px; FONT-FAMILY: "Trebuchet MS", Verdana, =
sans-serif
}
A {
COLOR: #2a5685
}
A:link {
COLOR: #2a5685
}
A:visited {
COLOR: #2a5685
}
A:hover {
COLOR: #c61a1a
}
A:active {
COLOR: #c61a1a
}
HR {
BORDER-RIGHT: 0px; BORDER-TOP: 0px; BACKGROUND: #ccc; BORDER-LEFT: 0px; =
WIDTH: 100%; BORDER-BOTTOM: 0px; HEIGHT: 1px
}
.footer {
FONT-SIZE: 0.8em; FONT-STYLE: italic
}
</STYLE>
<META content=3D"MSHTML 6.00.2900.2883" name=3DGENERATOR></HEAD>
<BODY bgColor=3D#ffffff>
<DIV><SPAN class=3Dfooter><FONT face=3DArial color=3D#000000 =
size=3D2>This is=20
reply</FONT></DIV></SPAN></BODY></HTML>
------=_NextPart_000_0067_01C8D3CE.711F9CC0--
test/unit/mail_handler_test.rb
View file @
3d164f1d
...
...
@@ -301,6 +301,15 @@ class MailHandlerTest < ActiveSupport::TestCase
assert_equal
'Feature request'
,
journal
.
issue
.
tracker
.
name
end
test
"reply to issue update (Journal) by message_id"
do
journal
=
submit_email
(
'ticket_reply_by_message_id.eml'
)
assert
journal
.
is_a?
(
IssueJournal
),
"Email was a
#{
journal
.
class
}
"
assert_equal
User
.
find_by_login
(
'jsmith'
),
journal
.
user
assert_equal
Issue
.
find
(
2
),
journal
.
journaled
assert_match
/This is reply/
,
journal
.
notes
assert_equal
'Feature request'
,
journal
.
issue
.
tracker
.
name
end
def
test_add_issue_note_with_attribute_changes
# This email contains: 'Status: Resolved'
journal
=
submit_email
(
'ticket_reply_with_status.eml'
)
...
...
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