mirror of
https://github.com/discourse/discourse.git
synced 2025-06-02 12:45:24 +08:00
FIX: Cap bookmark name at 100 chars and truncate existing names (#10189)
We have a couple of examples of enormous amounts of text being entered in the name column of bookmarks. This is not desirable...it is just meant to be a short note / reminder of why you bookmarked this. This PR caps the column at 100 characters and truncates existing names in the database to 100 characters.
This commit is contained in:
@ -75,6 +75,13 @@ RSpec.describe BookmarkManager do
|
||||
end
|
||||
end
|
||||
|
||||
context "when the bookmark name is too long" do
|
||||
it "adds an error to the manager" do
|
||||
subject.create(post_id: post.id, name: "test" * 100)
|
||||
expect(subject.errors.full_messages).to include("Name is too long (maximum is 100 characters)")
|
||||
end
|
||||
end
|
||||
|
||||
context "when the reminder time is not provided when it needs to be" do
|
||||
let(:reminder_at) { nil }
|
||||
it "adds an error to the manager" do
|
||||
|
Reference in New Issue
Block a user