@@ -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,19 +365,21 class MailHandlerTest < ActiveSupport::TestCase | |||
|
357 | 365 | end |
|
358 | 366 | |
|
359 | 367 | def test_add_issue_with_invalid_attributes |
|
360 | issue = submit_email( | |
|
361 | 'ticket_with_invalid_attributes.eml', | |
|
362 | :allow_override => 'tracker,category,priority' | |
|
363 | ) | |
|
364 | assert issue.is_a?(Issue) | |
|
365 |
assert |
|
|
366 | issue.reload | |
|
367 | assert_nil issue.assigned_to | |
|
368 |
assert_nil issue. |
|
|
369 |
assert_nil issue. |
|
|
370 |
assert_ |
|
|
371 |
assert_equal |
|
|
372 | assert issue.description.include?('Lorem ipsum dolor sit amet, consectetuer adipiscing elit.') | |
|
368 | with_settings :default_issue_start_date_to_creation_date => '0' do | |
|
369 | issue = submit_email( | |
|
370 | 'ticket_with_invalid_attributes.eml', | |
|
371 | :allow_override => 'tracker,category,priority' | |
|
372 | ) | |
|
373 | assert issue.is_a?(Issue) | |
|
374 | assert !issue.new_record? | |
|
375 | issue.reload | |
|
376 | assert_nil issue.assigned_to | |
|
377 | assert_nil issue.start_date | |
|
378 | assert_nil issue.due_date | |
|
379 | assert_equal 0, issue.done_ratio | |
|
380 | assert_equal 'Normal', issue.priority.to_s | |
|
381 | assert issue.description.include?('Lorem ipsum dolor sit amet, consectetuer adipiscing elit.') | |
|
382 | end | |
|
373 | 383 | end |
|
374 | 384 | |
|
375 | 385 | def test_add_issue_with_invalid_project_should_be_assigned_to_default_project |
General Comments 0
You need to be logged in to leave comments.
Login now