@@ -198,6 +198,7 class MailHandler < ActionMailer::Base | |||
|
198 | 198 | issue.subject = '(no subject)' |
|
199 | 199 | end |
|
200 | 200 | issue.description = cleaned_up_text_body |
|
201 | issue.start_date ||= Date.today if Setting.default_issue_start_date_to_creation_date? | |
|
201 | 202 | |
|
202 | 203 | # add To and Cc as watchers before saving so the watchers can reply to Redmine |
|
203 | 204 | add_watchers(issue) |
@@ -205,6 +205,14 class MailHandlerTest < ActiveSupport::TestCase | |||
|
205 | 205 | assert_equal user, issue.assigned_to |
|
206 | 206 | end |
|
207 | 207 | |
|
208 | def test_add_issue_should_set_default_start_date | |
|
209 | with_settings :default_issue_start_date_to_creation_date => '1' do | |
|
210 | issue = submit_email('ticket_with_cc.eml', :issue => {:project => 'ecookbook'}) | |
|
211 | assert issue.is_a?(Issue) | |
|
212 | assert_equal Date.today, issue.start_date | |
|
213 | end | |
|
214 | end | |
|
215 | ||
|
208 | 216 | def test_add_issue_with_cc |
|
209 | 217 | issue = submit_email('ticket_with_cc.eml', :issue => {:project => 'ecookbook'}) |
|
210 | 218 | assert issue.is_a?(Issue) |
@@ -357,6 +365,7 class MailHandlerTest < ActiveSupport::TestCase | |||
|
357 | 365 | end |
|
358 | 366 | |
|
359 | 367 | def test_add_issue_with_invalid_attributes |
|
368 | with_settings :default_issue_start_date_to_creation_date => '0' do | |
|
360 | 369 | issue = submit_email( |
|
361 | 370 | 'ticket_with_invalid_attributes.eml', |
|
362 | 371 | :allow_override => 'tracker,category,priority' |
@@ -371,6 +380,7 class MailHandlerTest < ActiveSupport::TestCase | |||
|
371 | 380 | assert_equal 'Normal', issue.priority.to_s |
|
372 | 381 | assert issue.description.include?('Lorem ipsum dolor sit amet, consectetuer adipiscing elit.') |
|
373 | 382 | end |
|
383 | end | |
|
374 | 384 | |
|
375 | 385 | def test_add_issue_with_invalid_project_should_be_assigned_to_default_project |
|
376 | 386 | issue = submit_email('ticket_on_given_project.eml', :issue => {:project => 'ecookbook'}, :allow_override => 'project') do |email| |
General Comments 0
You need to be logged in to leave comments.
Login now