chore: € character at article model TITLE_CHARACTERS_ALLOWED (#17790)

This commit is contained in:
João Gabriel Quaresma 2022-05-31 13:26:30 -03:00 committed by GitHub
parent 87a58c2dcf
commit 2912365109
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View file

@ -83,6 +83,7 @@ class Article < ApplicationRecord
\u303d # Either a line chart plummeting or the letter M, not sure
\u3297 # Circled Ideograph Congratulation
\u3299 # Circled Ideograph Secret
\u20ac # Euro symbol (€)
\u{1f000}-\u{1ffff} # More common emoji
]+/m
# rubocop:enable Lint/DuplicateRegexpCharacterClassElement

View file

@ -237,6 +237,14 @@ RSpec.describe Article, type: :model do
expect(article.title).to eq allowed_title
end
it "allows Euro symbol (€)" do
allowed_title = "Euro code €€€"
article = create(:article, title: allowed_title)
expect(article.title).to eq allowed_title
end
it "produces a proper title" do
test_article = build(:article, title: "An Article Title")