git-svn-id: http://svn.redmine.org/redmine/branches/3.3-stable@15438
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