A platform for community discussion. Free, open, simple.
FIX: default channel name to topic title (#33754)
Joffrey JAFFEUX39686e646425
diff --git a/plugins/discourse-calendar/app/services/discourse_post_event/chat_channel_sync.rb b/plugins/discourse-calendar/app/services/discourse_post_event/chat_channel_sync.rbindex 37f9320a66f..b981f39b41e 100644--- a/plugins/discourse-calendar/app/services/discourse_post_event/chat_channel_sync.rb+++ b/plugins/discourse-calendar/app/services/discourse_post_event/chat_channel_sync.rb@@ -48,7 +48,7 @@ module DiscoursePostEventenddef self.ensure_chat_channel!(event, guardian:)- name = event.name+ name = event.name || event.post.topic.titlechannel = nilChat::CreateCategoryChannel.call(diff --git a/plugins/discourse-calendar/spec/services/discourse_post_event/chat_channel_sync_spec.rb b/plugins/discourse-calendar/spec/services/discourse_post_event/chat_channel_sync_spec.rbindex 5af48f70466..2879e23c94d 100644--- a/plugins/discourse-calendar/spec/services/discourse_post_event/chat_channel_sync_spec.rb+++ b/plugins/discourse-calendar/spec/services/discourse_post_event/chat_channel_sync_spec.rb@@ -8,7 +8,7 @@ describe DiscoursePostEvent::ChatChannelSync dofab!(:admin_post) { Fabricate(:post, user: admin) }it "is able to create a chat channel and sync members" do- event = Fabricate(:event, chat_enabled: true, post: admin_post)+ event = Fabricate(:event, chat_enabled: true, post: admin_post, name: "Test Event")expect(event.chat_channel_id).to be_presentexpect(event.chat_channel.name).to eq(event.name)@@ -27,4 +27,10 @@ describe DiscoursePostEvent::ChatChannelSync doexpect(event.chat_channel_id).to be_nilend++ it "defaults event name to post title" do+ event = Fabricate(:event, chat_enabled: true, post: admin_post)++ expect(event.chat_channel.name).to eq(admin_post.topic.title)+ endend