DEV: prevents flakey test (#19976)

This commit is contained in:
Joffrey JAFFEUX 2023-01-24 17:38:41 +01:00 committed by GitHub
parent 8b72f489e1
commit 857f35f920
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 7 deletions

View File

@ -238,16 +238,19 @@ RSpec.describe Chat::Api::ChatChannelsController do
end
it "generates a valid new slug to prevent collisions" do
SiteSetting.max_topic_title_length = 15
SiteSetting.max_topic_title_length = 20
channel_1 = Fabricate(:chat_channel, name: "a" * SiteSetting.max_topic_title_length)
freeze_time(DateTime.parse("2022-07-08 09:30:00"))
old_slug = channel_1.slug
delete "/chat/api/channels/#{channel_1.id}",
params: {
channel: {
name_confirmation: channel_1.title(current_user),
},
}
delete(
"/chat/api/channels/#{channel_1.id}",
params: {
channel: {
name_confirmation: channel_1.title(current_user),
},
},
)
expect(response.status).to eq(200)
expect(channel_1.reload.slug).to eq(