@@ -224,7 +224,7 class MailHandler < ActionMailer::Base | |||
|
224 | 224 | @keywords[attr] |
|
225 | 225 | else |
|
226 | 226 | @keywords[attr] = begin |
|
227 | if (options[:override] || @@handler_options[:allow_override].include?(attr.to_s)) && plain_text_body.gsub!(/^#{attr}:[ \t]*(.+)\s*$/i, '') | |
|
227 | if (options[:override] || @@handler_options[:allow_override].include?(attr.to_s)) && plain_text_body.gsub!(/^#{attr}[ \t]*:[ \t]*(.+)\s*$/i, '') | |
|
228 | 228 | $1.strip |
|
229 | 229 | elsif !@@handler_options[:issue][attr].blank? |
|
230 | 230 | @@handler_options[:issue][attr] |
@@ -95,6 +95,21 class MailHandlerTest < Test::Unit::TestCase | |||
|
95 | 95 | assert issue.description.include?('Lorem ipsum dolor sit amet, consectetuer adipiscing elit.') |
|
96 | 96 | end |
|
97 | 97 | |
|
98 | def test_add_issue_with_spaces_between_attribute_and_separator | |
|
99 | issue = submit_email('ticket_with_spaces_between_attribute_and_separator.eml', :allow_override => 'tracker,category,priority') | |
|
100 | assert issue.is_a?(Issue) | |
|
101 | assert !issue.new_record? | |
|
102 | issue.reload | |
|
103 | assert_equal 'New ticket on a given project', issue.subject | |
|
104 | assert_equal User.find_by_login('jsmith'), issue.author | |
|
105 | assert_equal Project.find(2), issue.project | |
|
106 | assert_equal 'Feature request', issue.tracker.to_s | |
|
107 | assert_equal 'Stock management', issue.category.to_s | |
|
108 | assert_equal 'Urgent', issue.priority.to_s | |
|
109 | assert issue.description.include?('Lorem ipsum dolor sit amet, consectetuer adipiscing elit.') | |
|
110 | end | |
|
111 | ||
|
112 | ||
|
98 | 113 | def test_add_issue_with_attachment_to_specific_project |
|
99 | 114 | issue = submit_email('ticket_with_attachment.eml', :issue => {:project => 'onlinestore'}) |
|
100 | 115 | assert issue.is_a?(Issue) |
General Comments 0
You need to be logged in to leave comments.
Login now