mirror of
https://github.com/discourse/discourse.git
synced 2024-12-12 02:03:40 +08:00
0a5f548635
As part of this move, we are also renaming `discourse-chat` to `chat`.
18 lines
490 B
Ruby
18 lines
490 B
Ruby
# frozen_string_literal: true
|
|
|
|
require "rails_helper"
|
|
|
|
describe ChatPublisher do
|
|
fab!(:channel) { Fabricate(:category_channel) }
|
|
fab!(:message) { Fabricate(:chat_message, chat_channel: channel) }
|
|
|
|
describe ".publish_refresh!" do
|
|
it "publishes the message" do
|
|
data = MessageBus.track_publish { ChatPublisher.publish_refresh!(channel, message) }[0].data
|
|
|
|
expect(data["chat_message"]["id"]).to eq(message.id)
|
|
expect(data["type"]).to eq("refresh")
|
|
end
|
|
end
|
|
end
|