git-svn-id: http://svn.redmine.org/redmine/branches/3.2-stable@15439
e93f8b46-1217-0410-a6f0-
8f06a7374b81
end
def value_from_keyword(custom_field, keyword, object)
- value = custom_field.enumerations.where("LOWER(name) LIKE LOWER(?)", keyword)
+ value = custom_field.enumerations.where("LOWER(name) LIKE LOWER(?)", keyword).first
value ? value.id : nil
end
end
end
end
end
+
+ def test_value_from_keyword_should_return_enumeration_id
+ assert_equal @foo.id, @field.value_from_keyword('foo', nil)
+ end
end