summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-13 13:14:46 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-12-13 13:14:46 +0000
commit0a773bcbb3ecc5ae82abeb4b409e6f3225e14190 (patch)
treecb7e30383739ae0f1fba2c315d9546f9f94a9989 /test
parentb99a6f11f3b32f9d48efb7659e47a1ff12387311 (diff)
downloadredmine-0a773bcbb3ecc5ae82abeb4b409e6f3225e14190.tar.gz
redmine-0a773bcbb3ecc5ae82abeb4b409e6f3225e14190.zip
Fixed that validation fails when receiving an email with list custom fields (#12400).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10992 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/fixtures/mail_handler/ticket_with_custom_fields.eml1
-rw-r--r--test/unit/custom_field_test.rb5
-rw-r--r--test/unit/mail_handler_test.rb4
3 files changed, 8 insertions, 2 deletions
diff --git a/test/fixtures/mail_handler/ticket_with_custom_fields.eml b/test/fixtures/mail_handler/ticket_with_custom_fields.eml
index f3798a4b6..58dde7e0f 100644
--- a/test/fixtures/mail_handler/ticket_with_custom_fields.eml
+++ b/test/fixtures/mail_handler/ticket_with_custom_fields.eml
@@ -39,3 +39,4 @@ pulvinar dui, a gravida orci mi eget odio. Nunc a lacus.
category: Stock management
searchable field: Value for a custom field
+Database: postgresql
diff --git a/test/unit/custom_field_test.rb b/test/unit/custom_field_test.rb
index d858045ed..c3e9962f2 100644
--- a/test/unit/custom_field_test.rb
+++ b/test/unit/custom_field_test.rb
@@ -218,4 +218,9 @@ class CustomFieldTest < ActiveSupport::TestCase
assert_nil CustomField.new(:field_format => 'text').value_class
assert_nil CustomField.new.value_class
end
+
+ def test_value_from_keyword_for_list_custom_field
+ field = CustomField.find(1)
+ assert_equal 'PostgreSQL', field.value_from_keyword('postgresql', Issue.find(1))
+ end
end
diff --git a/test/unit/mail_handler_test.rb b/test/unit/mail_handler_test.rb
index 798d3b592..92d007c36 100644
--- a/test/unit/mail_handler_test.rb
+++ b/test/unit/mail_handler_test.rb
@@ -177,8 +177,8 @@ class MailHandlerTest < ActiveSupport::TestCase
assert !issue.new_record?
issue.reload
assert_equal 'New ticket with custom field values', issue.subject
- assert_equal 'Value for a custom field',
- issue.custom_value_for(CustomField.find_by_name('Searchable field')).value
+ assert_equal 'PostgreSQL', issue.custom_field_value(1)
+ assert_equal 'Value for a custom field', issue.custom_field_value(2)
assert !issue.description.match(/^searchable field:/i)
end