##// END OF EJS Templates
Added "assigned to" field in mail notifications....
Jean-Philippe Lang -
r524:270e3a4345f2
parent child
Show More
@@ -1,7 +1,8
1 <%=l(:label_issue)%> #<%= issue.id %> - <%= issue.subject %>
1 <%=l(:label_issue)%> #<%= issue.id %> - <%= issue.subject %>
2 <%=l(:field_author)%>: <%= issue.author.display_name %>
2 <%=l(:field_author)%>: <%= issue.author.display_name %>
3 <%=l(:field_assigned_to)%>: <%= issue.assigned_to ? issue.assigned_to.name : "-" %>
3 <%=l(:field_status)%>: <%= issue.status.name %>
4 <%=l(:field_status)%>: <%= issue.status.name %>
4
5
5 <%= issue.description %>
6 <%= issue.description %>
6
7
7 http://<%= Setting.host_name %>/issues/show/<%= issue.id %> No newline at end of file
8 http://<%= Setting.host_name %>/issues/show/<%= issue.id %>
@@ -1,57 +1,57
1 # redMine - project management software
1 # redMine - project management software
2 # Copyright (C) 2006-2007 Jean-Philippe Lang
2 # Copyright (C) 2006-2007 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 require File.dirname(__FILE__) + '/../test_helper'
18 require File.dirname(__FILE__) + '/../test_helper'
19
19
20 class MailHandlerTest < Test::Unit::TestCase
20 class MailHandlerTest < Test::Unit::TestCase
21 fixtures :users, :projects, :roles, :members, :permissions, :issues, :permissions_roles, :trackers, :enumerations
21 fixtures :users, :projects, :roles, :members, :permissions, :issues, :permissions_roles, :trackers, :enumerations
22
22
23 FIXTURES_PATH = File.dirname(__FILE__) + '/../fixtures'
23 FIXTURES_PATH = File.dirname(__FILE__) + '/../fixtures'
24 CHARSET = "utf-8"
24 CHARSET = "utf-8"
25
25
26 include ActionMailer::Quoting
26 include ActionMailer::Quoting
27
27
28 def setup
28 def setup
29 ActionMailer::Base.delivery_method = :test
29 ActionMailer::Base.delivery_method = :test
30 ActionMailer::Base.perform_deliveries = true
30 ActionMailer::Base.perform_deliveries = true
31 ActionMailer::Base.deliveries = []
31 ActionMailer::Base.deliveries = []
32
32
33 @expected = TMail::Mail.new
33 @expected = TMail::Mail.new
34 @expected.set_content_type "text", "plain", { "charset" => CHARSET }
34 @expected.set_content_type "text", "plain", { "charset" => CHARSET }
35 @expected.mime_version = '1.0'
35 @expected.mime_version = '1.0'
36 end
36 end
37
37
38 def test_add_note_to_issue
38 def test_add_note_to_issue
39 raw = read_fixture("add_note_to_issue_2.txt").join
39 raw = read_fixture("add_note_to_issue.txt").join
40 MailHandler.receive(raw)
40 MailHandler.receive(raw)
41
41
42 issue = Issue.find(2)
42 issue = Issue.find(2)
43 journal = issue.journals.find(:first, :order => "created_on DESC")
43 journal = issue.journals.find(:first, :order => "created_on DESC")
44 assert journal
44 assert journal
45 assert_equal User.find_by_mail("jsmith@somenet.foo"), journal.user
45 assert_equal User.find_by_mail("jsmith@somenet.foo"), journal.user
46 assert_equal "Note added by mail", journal.notes
46 assert_equal "Note added by mail", journal.notes
47 end
47 end
48
48
49 private
49 private
50 def read_fixture(action)
50 def read_fixture(action)
51 IO.readlines("#{FIXTURES_PATH}/mail_handler/#{action}")
51 IO.readlines("#{FIXTURES_PATH}/mail_handler/#{action}")
52 end
52 end
53
53
54 def encode(subject)
54 def encode(subject)
55 quoted_printable(subject, CHARSET)
55 quoted_printable(subject, CHARSET)
56 end
56 end
57 end
57 end
General Comments 0
You need to be logged in to leave comments. Login now