discourse/plugins/chat/spec/services/chat_publisher_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

18 lines
490 B
Ruby
Raw Normal View History

# 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