summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2018-04-24 02:40:21 +0000
committerGo MAEDA <maeda@farend.jp>2018-04-24 02:40:21 +0000
commita9bf2b763cfec74a8490b5836e9034e372ba58a9 (patch)
tree5e2acb639cf30cab5685407e2dfd090cbc6c5c92 /test
parentfe7e8f1d3b87f2da79db4739082718447773dc34 (diff)
downloadredmine-a9bf2b763cfec74a8490b5836e9034e372ba58a9.tar.gz
redmine-a9bf2b763cfec74a8490b5836e9034e372ba58a9.zip
Allow setting "Parent issue" attribute in emails (#27070).
Patch by Mizuki ISHIKAWA. git-svn-id: http://svn.redmine.org/redmine/trunk@17304 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/fixtures/mail_handler/ticket_on_given_project.eml1
-rw-r--r--test/unit/mail_handler_test.rb6
2 files changed, 6 insertions, 1 deletions
diff --git a/test/fixtures/mail_handler/ticket_on_given_project.eml b/test/fixtures/mail_handler/ticket_on_given_project.eml
index e311dfbb7..9cfab2a06 100644
--- a/test/fixtures/mail_handler/ticket_on_given_project.eml
+++ b/test/fixtures/mail_handler/ticket_on_given_project.eml
@@ -38,6 +38,7 @@ Assigned to: John Smith
fixed version: alpha
estimated hours: 2.5
done ratio: 30
+parent issue: 1
--- This line starts with a delimiter and should not be stripped
diff --git a/test/unit/mail_handler_test.rb b/test/unit/mail_handler_test.rb
index f2dc36495..62875b9a0 100644
--- a/test/unit/mail_handler_test.rb
+++ b/test/unit/mail_handler_test.rb
@@ -43,7 +43,7 @@ class MailHandlerTest < ActiveSupport::TestCase
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?
@@ -60,6 +60,7 @@ class MailHandlerTest < ActiveSupport::TestCase
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)
@@ -81,6 +82,7 @@ class MailHandlerTest < ActiveSupport::TestCase
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
@@ -102,6 +104,7 @@ class MailHandlerTest < ActiveSupport::TestCase
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
@@ -474,6 +477,7 @@ class MailHandlerTest < ActiveSupport::TestCase
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