discourse/plugins/chat/spec/services/chat_publisher_spec.rb
Roman Rizzi 0a5f548635
DEV: Move discourse-chat to the core repo. (#18776)
As part of this move, we are also renaming `discourse-chat` to `chat`.
2022-11-02 10:41:30 -03:00

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