Feature #27070 ยป add_parent_issue.patch
| app/models/mail_handler.rb | ||
|---|---|---|
|
'start_date' => get_keyword(:start_date, :format => '\d{4}-\d{2}-\d{2}'),
|
||
|
'due_date' => get_keyword(:due_date, :format => '\d{4}-\d{2}-\d{2}'),
|
||
|
'estimated_hours' => get_keyword(:estimated_hours),
|
||
|
'done_ratio' => get_keyword(:done_ratio, :format => '(\d|10)?0')
|
||
|
'done_ratio' => get_keyword(:done_ratio, :format => '(\d|10)?0'),
|
||
|
'parent_issue_id' => get_keyword(:parent_issue)
|
||
|
}.delete_if {|k, v| v.blank? }
|
||
|
attrs
|
||
| test/fixtures/mail_handler/ticket_on_given_project.eml | ||
|---|---|---|
|
fixed version: alpha
|
||
|
estimated hours: 2.5
|
||
|
done ratio: 30
|
||
|
parent issue: 4
|
||
|
--- This line starts with a delimiter and should not be stripped
|
||
| test/unit/mail_handler_test.rb | ||
|---|---|---|
|
def test_add_issue_with_specific_overrides
|
||
|
issue = submit_email('ticket_on_given_project.eml',
|
||
|
:allow_override => ['status', 'start_date', 'due_date', 'assigned_to',
|
||
|
'fixed_version', 'estimated_hours', 'done_ratio']
|
||
|
'fixed_version', 'estimated_hours', 'done_ratio', 'parent_issue']
|
||
|
)
|
||
|
assert issue.is_a?(Issue)
|
||
|
assert !issue.new_record?
|
||
| ... | ... | |
|
assert_equal Version.find_by_name('Alpha'), issue.fixed_version
|
||
|
assert_equal 2.5, issue.estimated_hours
|
||
|
assert_equal 30, issue.done_ratio
|
||
|
assert_equal Issue.find(4), issue.parent
|
||
|
# keywords should be removed from the email body
|
||
|
assert !issue.description.match(/^Project:/i)
|
||
|
assert !issue.description.match(/^Status:/i)
|
||
| ... | ... | |
|
assert_equal Version.find_by_name('Alpha'), issue.fixed_version
|
||
|
assert_equal 2.5, issue.estimated_hours
|
||
|
assert_equal 30, issue.done_ratio
|
||
|
assert_equal Issue.find(4), issue.parent
|
||
|
end
|
||
|
def test_add_issue_without_overrides_should_ignore_attributes
|
||
| ... | ... | |
|
assert_nil issue.fixed_version
|
||
|
assert_nil issue.estimated_hours
|
||
|
assert_equal 0, issue.done_ratio
|
||
|
assert_nil issue.parent
|
||
|
end
|
||
|
def test_add_issue_to_project_specified_by_subaddress
|
||
| ... | ... | |
|
assert_nil issue.start_date
|
||
|
assert_nil issue.due_date
|
||
|
assert_equal 0, issue.done_ratio
|
||
|
assert_nil issue.parent
|
||
|
assert_equal 'Normal', issue.priority.to_s
|
||
|
assert issue.description.include?('Lorem ipsum dolor sit amet, consectetuer adipiscing elit.')
|
||
|
end
|
||