mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 09:03:44 +08:00
DEV: uses alphanumeric to avoid flakey specs (#24344)
Faker text with quotes or thread dots for example would cause issues in tests due to cooking.
This commit is contained in:
parent
8444c865e9
commit
208491fa00
|
@ -67,7 +67,7 @@ end
|
|||
Fabricator(:chat_message_without_service, class_name: "Chat::Message") do
|
||||
user
|
||||
chat_channel
|
||||
message { Faker::Lorem.words(number: 5).join(" ") }
|
||||
message { Faker::Alphanumeric.alpha(number: SiteSetting.chat_minimum_message_length) }
|
||||
|
||||
after_build { |message, attrs| message.cook }
|
||||
after_create { |message, attrs| message.upsert_mentions }
|
||||
|
@ -94,7 +94,9 @@ Fabricator(:chat_message_with_service, class_name: "Chat::CreateMessage") do
|
|||
resolved_class.call(
|
||||
chat_channel_id: channel.id,
|
||||
guardian: user.guardian,
|
||||
message: transients[:message] || Faker::Lorem.words(number: 5).join(" "),
|
||||
message:
|
||||
transients[:message] ||
|
||||
Faker::Alphanumeric.alpha(number: SiteSetting.chat_minimum_message_length),
|
||||
thread_id: transients[:thread]&.id,
|
||||
in_reply_to_id: transients[:in_reply_to]&.id,
|
||||
upload_ids: transients[:upload_ids],
|
||||
|
|
Loading…
Reference in New Issue
Block a user