@custom_field_values = nil
result
end
+
+ def description=(arg)
+ if arg.is_a?(String)
+ arg = arg.gsub(/(\r\n|\n|\r)/, "\r\n")
+ end
+ write_attribute(:description, arg)
+ end
# Overrides attributes= so that tracker_id gets assigned first
def attributes_with_tracker_first=(new_attributes, *args)
IssueCustomField.delete_all
Issue.update_all("description = NULL", "id=1")
- i = Issue.first
+ i = Issue.find(1)
i.init_journal(User.find(2))
i.subject = "blank description"
i.description = "\r\n"
end
end
end
+
+ def test_description_eol_should_be_normalized
+ i = Issue.new(:description => "CR \r LF \n CRLF \r\n")
+ assert_equal "CR \r\n LF \r\n CRLF \r\n", i.description
+ end
def test_saving_twice_should_not_duplicate_journal_details
i = Issue.find(:first)