mirror of
https://github.com/opf/openproject.git
synced 2026-06-13 19:20:00 +00:00
Merge pull request #23471 from opf/fix/21890-letters-after-a-space-in-the-document-ty
[OP-18996] fix: Do not adjust capitalization of new document types
This commit is contained in:
@@ -38,7 +38,7 @@ class DocumentType < ApplicationRecord
|
||||
dependent: :nullify,
|
||||
inverse_of: :type
|
||||
|
||||
normalizes :name, with: ->(name) { name.strip.capitalize }
|
||||
normalizes :name, with: ->(name) { name.strip }
|
||||
|
||||
validates :name, presence: true, uniqueness: { case_sensitive: false }
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ RSpec.describe DocumentType do
|
||||
end
|
||||
|
||||
describe "Normalizations" do
|
||||
it { is_expected.to normalize(:name).from(" reImburseMEnt RequeSt ").to("Reimbursement request") }
|
||||
it { is_expected.to normalize(:name).from(" reImburseMEnt RequeSt ").to("reImburseMEnt RequeSt") }
|
||||
end
|
||||
|
||||
describe "Validations" do
|
||||
|
||||
Reference in New Issue
Block a user