mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Fix user_status_controller_spec flakiness (#20083)
In some situations, these HTTP calls would cause some cache to warmup and send a `/distributed_hash` message-bus message. We can avoid tracking those by passing a specific channel name to `track_publish`.
This commit is contained in:
parent
7c1e1ef72b
commit
4d12bdfdcb
@ -158,7 +158,7 @@ RSpec.describe UserStatusController do
|
||||
ends_at = "2100-01-01T18:00:00Z"
|
||||
|
||||
messages =
|
||||
MessageBus.track_publish do
|
||||
MessageBus.track_publish("/user-status") do
|
||||
put "/user-status.json", params: { description: status, emoji: emoji, ends_at: ends_at }
|
||||
end
|
||||
|
||||
@ -207,7 +207,7 @@ RSpec.describe UserStatusController do
|
||||
end
|
||||
|
||||
it "publishes to message bus" do
|
||||
messages = MessageBus.track_publish { delete "/user-status.json" }
|
||||
messages = MessageBus.track_publish("/user-status") { delete "/user-status.json" }
|
||||
|
||||
expect(messages.size).to eq(1)
|
||||
expect(messages[0].channel).to eq("/user-status")
|
||||
|
Loading…
Reference in New Issue
Block a user