Improve MessageBus.track_publish to allow filter by channel.

This commit is contained in:
Guo Xiang Tan
2017-10-02 11:34:57 +08:00
parent b295a39977
commit c872225762
7 changed files with 28 additions and 39 deletions

View File

@@ -15,9 +15,8 @@ describe PostMerger do
reply3 = create_post(topic: topic, raw: 'The third reply', post_number: 4, user: user)
replies = [reply3, reply2, reply1]
message = MessageBus.track_publish { PostMerger.new(admin, replies).merge }.last
message = MessageBus.track_publish("/topic/#{topic.id}") { PostMerger.new(admin, replies).merge }.last
expect(message.channel).to eq("/topic/#{topic.id}")
expect(message.data[:type]).to eq(:revised)
expect(message.data[:post_number]).to eq(reply3.post_number)